aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libhomescreen.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libhomescreen.cpp b/src/libhomescreen.cpp
index 0462d4d..cfd382d 100644
--- a/src/libhomescreen.cpp
+++ b/src/libhomescreen.cpp
@@ -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)
{