Skip to content

Commit 7e9a9d8

Browse files
authored
Make sure processPluginSchemas param is always an Array
Fixes #52
1 parent 67c096b commit 7e9a9d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/ContentPluginModule.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,16 @@ class ContentPluginModule extends AbstractApiModule {
190190

191191
/**
192192
* Loads and processes all installed content plugin schemas
193-
* @param {Array} pluginInfo Plugin info data
193+
* @param {Array|Object} pluginInfo Plugin info data
194194
* @return {Promise}
195195
*/
196196
async processPluginSchemas (pluginInfo) {
197197
if (!pluginInfo) {
198198
pluginInfo = await this.framework.runCliCommand('getPluginUpdateInfos')
199199
}
200+
if (!Array.isArray(pluginInfo)) {
201+
pluginInfo = [pluginInfo]
202+
}
200203
const jsonschema = await this.app.waitForModule('jsonschema')
201204
return Promise.all(pluginInfo.map(async plugin => {
202205
const name = plugin.name
@@ -319,7 +322,7 @@ class ContentPluginModule extends AbstractApiModule {
319322
throw this.app.errors.CONTENTPLUGIN_ATTR_MISSING
320323
.setData({ name })
321324
}
322-
await this.processPluginSchemas([data])
325+
await this.processPluginSchemas(data)
323326
return info
324327
}
325328

0 commit comments

Comments
 (0)