X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-msg-json.c;h=8f543ff16a4c168733a5ed8a181d17cb408af196;hb=6518887513840471ea9c5af7e534787717e6bd82;hp=d5f6f5a5dddc3b01a2cf22f0ad56c0d4a1a6e1f2;hpb=741d4e0505c588f38a64350c1d3c53c74f7ac22c;p=src%2Fapp-framework-binder.git diff --git a/src/afb-msg-json.c b/src/afb-msg-json.c index d5f6f5a5..8f543ff1 100644 --- a/src/afb-msg-json.c +++ b/src/afb-msg-json.c @@ -47,13 +47,15 @@ struct json_object *afb_msg_json_reply(const char *status, const char *info, str if (reqid != NULL) json_object_object_add(request, "reqid", json_object_new_string(reqid)); - token = afb_context_sent_token(context); - if (token != NULL) - json_object_object_add(request, "token", json_object_new_string(token)); - - uuid = afb_context_sent_uuid(context); - if (uuid != NULL) - json_object_object_add(request, "uuid", json_object_new_string(uuid)); + if (context != NULL) { + token = afb_context_sent_token(context); + if (token != NULL) + json_object_object_add(request, "token", json_object_new_string(token)); + + uuid = afb_context_sent_uuid(context); + if (uuid != NULL) + json_object_object_add(request, "uuid", json_object_new_string(uuid)); + } return msg; }