diff options
-rw-r--r-- | daemon/src/ttd-build-json.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/src/ttd-build-json.c b/daemon/src/ttd-build-json.c index 855cf45..c15820c 100644 --- a/daemon/src/ttd-build-json.c +++ b/daemon/src/ttd-build-json.c @@ -45,7 +45,7 @@ report format "content" : { "code" : 0(int), "desc" : "xxxx"(string, optional), - "data" : "xxxx"(string, optional) + "data" : "xxxx"(json object, optional) }(json object) } */ @@ -85,7 +85,11 @@ char *ttd_build_json_create_report( json_object_object_add(content_object, "desc", tmp_object); if (json_data) { - tmp_object = json_object_new_string(json_data); + tmp_object = json_tokener_parse(json_data); + if (!tmp_object) { + _W("failed to parse report data - %s", json_data); + tmp_object = json_object_new_string(json_data); + } json_object_object_add(content_object, "data", tmp_object); } |