diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-04-21 11:19:50 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-04-21 11:19:50 +0200 |
commit | 727e705706be47066893bd483458c23e4c4e173c (patch) | |
tree | 9fcf0587fe48b970b33289107223abbec82dec4e | |
parent | 968c3fca18c7518f240d2487a561e8df8b2907a7 (diff) |
fix bug on incoming event
Change-Id: I7678412374565fd5802b0312e5808e2645df3728
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/afb-wsj1.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/afb-wsj1.c b/src/afb-wsj1.c index 7a8e0234..be961f51 100644 --- a/src/afb-wsj1.c +++ b/src/afb-wsj1.c @@ -85,7 +85,10 @@ struct afb_wsj1 *afb_wsj1_create(struct sd_event *eloop, int fd, struct afb_wsj1 { struct afb_wsj1 *result; + assert(eloop); assert(fd >= 0); + assert(itf); + assert(itf->on_call); result = calloc(1, sizeof * result); if (result == NULL) @@ -337,7 +340,8 @@ static void wsj1_on_text(struct afb_wsj1 *wsj1, char *text, size_t size) free(call); break; case EVENT: - wsj1->itf->on_event(wsj1->closure, msg->event, msg); + if (wsj1->itf->on_event != NULL) + wsj1->itf->on_event(wsj1->closure, msg->event, msg); break; } afb_wsj1_msg_unref(msg); |