Fix dbus delay when requesting hello
[platform/core/uifw/stt.git] / server / sttd_server.c
index 90f67ad..38b7a7f 100644 (file)
@@ -1085,7 +1085,10 @@ void __sttd_server_recorder_start(void* data)
        }
 
        app_state_e temp_app_state;
-       sttd_client_get_state(uid, &temp_app_state);
+       if (0 != sttd_client_get_state(uid, &temp_app_state)) {
+               SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] uid is NOT valid ");
+               return;
+       }
        if (APP_STATE_READY != temp_app_state && 0 != stt_client_get_current_recognition()) {
                /* Notify uid state change */
                sttdc_send_set_state(uid, APP_STATE_RECORDING);
@@ -1241,7 +1244,10 @@ int sttd_server_start(int uid, const char* lang, const char* recognition_type, i
                        return ret;
                }
 
-               sttd_client_get_state(uid, &temp_app_state);
+               if (0 != sttd_client_get_state(uid, &temp_app_state)) {
+                       SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] uid is NOT valid");
+                       return STTD_ERROR_INVALID_PARAMETER;
+               }
                if (APP_STATE_READY != temp_app_state && 0 != stt_client_get_current_recognition()) {
                        /* Notify uid state change */
                        sttdc_send_set_state(uid, APP_STATE_RECORDING);