summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-06-02 13:19:01 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-06-02 13:22:12 +0200
commitcc83f1893aa03e639dfa57ff58ce9f9875461b66 (patch)
tree75d390c819ebd7909430b87fa82dcab811b439b1
parentf7b298ae1c4f46bba07ddf9f9813c8fa85187d12 (diff)
Fix issue when JSON value is NULL in xreq
Change-Id: Ifb84a77abb0fee947fb05d80ac8276a8ede988af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-xreq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/afb-xreq.c b/src/afb-xreq.c
index e8a42226..fbed6ed1 100644
--- a/src/afb-xreq.c
+++ b/src/afb-xreq.c
@@ -55,7 +55,9 @@ static void vinfo(void *first, void *second, const char *fmt, va_list args, void
static struct json_object *xreq_json_cb(void *closure)
{
struct afb_xreq *xreq = closure;
- return xreq->json ? : (xreq->json = xreq->queryitf->json(xreq));
+ if (!xreq->json && xreq->queryitf->json)
+ xreq->json = xreq->queryitf->json(xreq);
+ return xreq->json;
}
static struct afb_arg xreq_get_cb(void *closure, const char *name)