Remove compile warning 75/16675/1 6.90.0 guppy/6.90.0 guppy_6.90.0
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Tue, 18 Sep 2018 08:48:41 +0000 (16:48 +0800)
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Tue, 18 Sep 2018 08:50:55 +0000 (16:50 +0800)
change from deprecated function 'json_object_object_get' to 'json_object_object_get_ex'.

Change-Id: I3ae6f1e39d1f05033568662bff9a2a35e2da5879
Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
src/libhomescreen.cpp

index 0462d4d..cfd382d 100644 (file)
@@ -459,7 +459,11 @@ void LibHomeScreen::on_event(void *closure, const char *event, struct afb_wsj1_m
        }
 
        struct json_object* ev_contents = afb_wsj1_msg_object_j(msg);
-       struct json_object *json_data = json_object_object_get(ev_contents, "data");
+       struct json_object *json_data;
+       if(!json_object_object_get_ex(ev_contents, "data", &json_data)) {
+               HMI_ERROR("libhomescreen", "got ev_contents error.");
+               return;
+       }
 
        if(onEvent != nullptr)
        {