add guard clause when use g_VoiceControlClients 53/289653/1
authorulgal-park <ulgal.park@samsung.com>
Mon, 13 Mar 2023 03:54:05 +0000 (12:54 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Mon, 13 Mar 2023 04:18:44 +0000 (13:18 +0900)
Change-Id: I36d7c0cccd8cee52a6948cbcf3af873e3ae950b9

common/vc_config_mgr.cpp

index 23a1fd1..e502e7e 100644 (file)
@@ -105,6 +105,11 @@ static void notify_language_changed(const char* before_lang, const char* current
                return;
        }
 
+       if (nullptr == g_VoiceControlClients) {
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] No clients exist");
+               return;
+       }
+
        auto clients = g_VoiceControlClients->getClients();
        for (auto &clientInfo : clients) {
                if (false == g_VoiceControlClients->isUidValid(clientInfo.getUid())) {