diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-16 18:38:10 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-17 12:34:47 +0200 |
commit | 5d25d9ea3a06f38ffa964ca94165d81fbc6194e1 (patch) | |
tree | 0e25b6e2a3d985cf8310159a91a6d0706b05afab | |
parent | 7af94b8a6f953ed247815bf15049fe951817a21e (diff) |
Don't use assert in controller.
Rather use tests with a test framework.
Change-Id: I1c626c7cc96403587a57ae23af67c95f6ed2f862
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | ctl-lib/ctl-action.c | 5 |
1 files 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 <stdio.h> #include <string.h> -#include <assert.h> - #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); |