From 5d25d9ea3a06f38ffa964ca94165d81fbc6194e1 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 16 May 2018 18:38:10 +0200 Subject: Don't use assert in controller. Rather use tests with a test framework. Change-Id: I1c626c7cc96403587a57ae23af67c95f6ed2f862 Signed-off-by: Romain Forlot --- ctl-lib/ctl-action.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c index e7c3361..e0388e0 100644 --- a/ctl-lib/ctl-action.c +++ b/ctl-lib/ctl-action.c @@ -21,8 +21,6 @@ #define _GNU_SOURCE #include #include -#include - #include "ctl-config.h" @@ -310,7 +308,8 @@ int ActionLoadOne(AFB_ApiT apiHandle, CtlActionT *action, json_object *actionJ, if (!err) { // in API V3 each control is optionally map to a verb #ifdef AFB_BINDING_PREV3 - assert(apiHandle); + if(!apiHandle) + return -1; action->api = apiHandle; if (exportApi) { err = afb_dynapi_add_verb(apiHandle, action->uid, action->info, ActionDynRequest, action, NULL, 0); -- cgit 1.2.3-korg