Fix wrong log to display mode, category, and type 12/227212/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 10 Mar 2020 10:32:20 +0000 (19:32 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 10 Mar 2020 11:18:29 +0000 (20:18 +0900)
Change-Id: I3aa7aac680e1902726acebc7b1ee2644aa8fcec8
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
receiver/src/main.cpp

index 1a2ad84..3ad20b5 100644 (file)
@@ -76,22 +76,26 @@ static void app_control(app_control_h app_control, void *data)
     res = app_control_get_extra_data(app_control, "request", &request);
     if (APP_CONTROL_ERROR_NONE == res && NULL != request) {
         if (strcmp(request, "sync") == 0) {
-            LOGI("[sync request] mode : %s, category : %s, type : %s", mode, category, type);
+            bool param_error = false;
             if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE) {
                 LOGE("No given mode");
-                goto cleanup;
+                param_error = true;
             }
 
             if (app_control_get_extra_data(app_control, "category", &category) != APP_CONTROL_ERROR_NONE) {
                 LOGE("No given category");
-                goto cleanup;
+                param_error = true;
             }
 
             if (app_control_get_extra_data(app_control, "type", &type) != APP_CONTROL_ERROR_NONE) {
                 LOGE("No given type");
-                goto cleanup;
+                param_error = true;
             }
 
+            LOGI("[sync request] mode : %s, category : %s, type : %s", mode, category, type);
+            if (param_error)
+                goto cleanup;
+
             if (mode && category && type)
                 request_sticker_data(mode, category, type);
         }