From f971508dcec80337abb1e2d90ae1f1caae2045c6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 10 Mar 2020 19:32:20 +0900 Subject: [PATCH] Fix wrong log to display mode, category, and type Change-Id: I3aa7aac680e1902726acebc7b1ee2644aa8fcec8 Signed-off-by: Jihoon Kim --- receiver/src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/receiver/src/main.cpp b/receiver/src/main.cpp index 1a2ad84..3ad20b5 100644 --- a/receiver/src/main.cpp +++ b/receiver/src/main.cpp @@ -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); } -- 2.7.4