aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-07-30 10:31:58 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-07-30 10:34:57 +0900
commit32f4569cb1f2e7770c935dc375c08747a414c8eb (patch)
tree087bde683957212375243324c2f335b9af43e39f
parent58f6609308a7fdf1035d1fd65c644febc862b122 (diff)
Fix problem when pointer is nullptr.
When event_only pointer is nullptr, print out a warning log and return. Change-Id: I1115cc1d17a1cbfa4b9a2cdee57fe56069a3fe81 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
-rw-r--r--src/libhomescreen.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libhomescreen.cpp b/src/libhomescreen.cpp
index f0e61b0..0462d4d 100644
--- a/src/libhomescreen.cpp
+++ b/src/libhomescreen.cpp
@@ -470,6 +470,9 @@ void LibHomeScreen::on_event(void *closure, const char *event, struct afb_wsj1_m
const char* event_only = strchr(event, '/');
if (event_only != nullptr) {
event_only = event_only + 1;
+ }else{
+ HMI_WARNING("libhomescreen","event_only is null.");
+ return;
}
if (strcasecmp(event_only, LibHomeScreen::event_list[0].c_str()) == 0) {