From: José Bollo Date: Fri, 2 Jun 2017 11:19:01 +0000 (+0200) Subject: Fix issue when JSON value is NULL in xreq X-Git-Tag: dab_3.99.2~26 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=cc83f1893aa03e639dfa57ff58ce9f9875461b66;p=src%2Fapp-framework-binder.git Fix issue when JSON value is NULL in xreq Change-Id: Ifb84a77abb0fee947fb05d80ac8276a8ede988af Signed-off-by: José Bollo --- 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)