aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index 12bf963..be3a2bf 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -417,7 +417,8 @@ static int PluginParse(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pl
memcpy(ctlPluginsNew, ctlPluginsOrig, idx * sizeof(CtlPluginT));
while(idx < totalPluginNumber) {
- json_object *pluginJ = json_object_array_get_idx(pluginsJ, idx);
+ json_object *pluginJ = json_object_is_type(pluginsJ, json_type_array) ?
+ json_object_array_get_idx(pluginsJ, idx) : pluginsJ;
err += PluginLoad(apiHandle, &ctlPluginsNew[idx], pluginJ, section->handle, section->prefix);
idx++;
}