Fix problem when pointer is nullptr.
[src/libhomescreen.git] / src / libhomescreen.cpp
index f0e61b0..0462d4d 100644 (file)
@@ -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) {