From cc83f1893aa03e639dfa57ff58ce9f9875461b66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 2 Jun 2017 13:19:01 +0200 Subject: [PATCH] Fix issue when JSON value is NULL in xreq MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ifb84a77abb0fee947fb05d80ac8276a8ede988af Signed-off-by: José Bollo --- src/afb-xreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.16.6