aboutsummaryrefslogtreecommitdiffstats
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-13 15:02:55 +0100
commitcfc869a7a461bdf0be3157c96cb537ba8e63660d (patch)
tree488bba53697bdea0c0b844c15a4d0801be779652
parent26d581e7727ef952d1f849800b33961a36393b5c (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>
-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++;
}