diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-16 18:38:10 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 15:02:54 +0100 |
commit | 259e48fe0e44b4ef47d2a13c37b67c063658a99c (patch) | |
tree | 0e25b6e2a3d985cf8310159a91a6d0706b05afab /ctl-lib | |
parent | 240718d4dd333323af06ebae574427b1ee48290b (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>
Diffstat (limited to 'ctl-lib')
-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); |