summaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
authorFrederic Marec <frederic.marec@iot.bzh>2018-11-28 09:33:23 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-12 17:44:41 +0100
commit88d6ac08d92cd62996a8e0667842000958556562 (patch)
treef879fda7900c0161e94b4d4bb169cbb0f2ff201b /ctl-lib
parente849d36204e9791eb6f49165162f7bc05cecb776 (diff)
Fix Parse plugin
Fix PluginParse in ctlplugin to handle json_object case Change-Id: Iaeacaaef3dc09ca28229e16aed992003aa3b02cf Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
Diffstat (limited to 'ctl-lib')
-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++;
}