iu: fix issue not to check NULL 99/264399/1 accepted/tizen/unified/20210920.131433 submit/tizen/20210917.040337
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 17 Sep 2021 02:59:21 +0000 (11:59 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 17 Sep 2021 03:51:36 +0000 (12:51 +0900)
Change-Id: Ib54462c4233e30836fd5efc575affb67257fcb4f
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/mmimgr/mmi-iu-bridge.c

index 3a804d4..797359b 100644 (file)
@@ -80,33 +80,35 @@ static void output_intent_received_cb(const char *app_id, const char *json_data,
        action = json_object_get_string_member(root_obj, "Action");
        LOGD("Action: %s\n", action);
 
-       if (strcmp(action, "WakeUp") == 0) {
-               wakeup_event_arg arg;
-               arg.type = MMI_EVENT_WAKEUP_TYPE_WAKEUP;
-               arg.source = NULL;
-               arg.timestamp = ecore_time_get();
-
-               client_manager_send_wakeup_event(g_client, &arg);
-       }
-       else if (strcmp(action, "Execute") == 0) {
-               arg.type = MMI_EVENT_ACTION_TYPE_EXECUTE;
-               client_manager_send_action_event(g_client, &arg);
-       }
-       else if (strcmp(action, "Play") == 0) {
-               arg.type = MMI_EVENT_ACTION_TYPE_PLAY;
-               client_manager_send_action_event(g_client, &arg);
-       }
-       else if (strcmp(action, "Cancel") == 0) {
-               arg.type = MMI_EVENT_ACTION_TYPE_CANCEL;
-               client_manager_send_action_event(g_client, &arg);
-       }
-       else if (strcmp(action, "Pause") == 0) {
-               arg.type = MMI_EVENT_ACTION_TYPE_PAUSE;
-               client_manager_send_action_event(g_client, &arg);
-       }
-       else if (strcmp(action, "Stop") == 0) {
-               arg.type = MMI_EVENT_ACTION_TYPE_STOP;
-               client_manager_send_action_event(g_client, &arg);
+       if (action) {
+               if (strcmp(action, "WakeUp") == 0) {
+                       wakeup_event_arg arg;
+                       arg.type = MMI_EVENT_WAKEUP_TYPE_WAKEUP;
+                       arg.source = NULL;
+                       arg.timestamp = ecore_time_get();
+
+                       client_manager_send_wakeup_event(g_client, &arg);
+               }
+               else if (strcmp(action, "Execute") == 0) {
+                       arg.type = MMI_EVENT_ACTION_TYPE_EXECUTE;
+                       client_manager_send_action_event(g_client, &arg);
+               }
+               else if (strcmp(action, "Play") == 0) {
+                       arg.type = MMI_EVENT_ACTION_TYPE_PLAY;
+                       client_manager_send_action_event(g_client, &arg);
+               }
+               else if (strcmp(action, "Cancel") == 0) {
+                       arg.type = MMI_EVENT_ACTION_TYPE_CANCEL;
+                       client_manager_send_action_event(g_client, &arg);
+               }
+               else if (strcmp(action, "Pause") == 0) {
+                       arg.type = MMI_EVENT_ACTION_TYPE_PAUSE;
+                       client_manager_send_action_event(g_client, &arg);
+               }
+               else if (strcmp(action, "Stop") == 0) {
+                       arg.type = MMI_EVENT_ACTION_TYPE_STOP;
+                       client_manager_send_action_event(g_client, &arg);
+               }
        }
 
 cleanup: