From e45d063fb5b4c45d92eb74df985075813e3b71a4 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 4 Jul 2018 17:30:02 +0200 Subject: Execute ConfigExec only if section is existing Test again if the section is present in the configuration JSON object before executing the callback. Change-Id: Ibad352e8443d5d33d7e727fc3b80c56a377c75d3 Signed-off-by: Romain Forlot --- ctl-lib/ctl-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c index fcd0e02..3153f13 100644 --- a/ctl-lib/ctl-config.c +++ b/ctl-lib/ctl-config.c @@ -154,7 +154,7 @@ int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) { if (!ctlConfig->sections[idx].loadCB) AFB_ApiNotice(apiHandle, "CtlConfigLoad: notice empty section '%s'", ctlConfig->sections[idx].key); - else + else if (json_object_object_get_ex(ctlConfig->configJ, ctlConfig->sections[idx].key, NULL)) errcount += ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL); } -- cgit 1.2.3-korg