summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-14 10:24:32 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-11-14 10:24:32 +0100
commit5dea708711fb10b3c02f2d8970a9ebe381feb620 (patch)
tree373684681ea528b65abfe4efbff573aa64a20d90 /signal-composer-binding/signal-composer.cpp
parentaa591bb619531b84d21ba6784d9f111ea8b36882 (diff)
sig-comp: Fix core dump when adding a signal...icefish_8.99.1icefish/8.99.18.99.1
Fix core dump when adding a signal with a wrong source's api name. This commit avoids the crash and throw an error through the journal log of the binding service. Bug-AGL: SPEC-2956 Change-Id: Idf052df05d76f831f56ec3c565bacf821b9b4e69 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer.cpp')
-rw-r--r--signal-composer-binding/signal-composer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp
index 9abe54e..e8e7668 100644
--- a/signal-composer-binding/signal-composer.cpp
+++ b/signal-composer-binding/signal-composer.cpp
@@ -259,6 +259,11 @@ int Composer::loadOneSignal(afb_api_t apihandle, json_object* signalJ)
}
std::string api = eventStr.substr(0, sep);
src = getSourceAPI(api);
+ if(!src)
+ {
+ AFB_ERROR("Can't find the source API %s for the event %s. Check you configuration.", api.c_str(), eventStr.c_str());
+ return -1;
+ }
}
else
{