From: ulgal-park Date: Mon, 13 Mar 2023 03:54:05 +0000 (+0900) Subject: add guard clause when use g_VoiceControlClients X-Git-Tag: accepted/tizen/unified/20230314.093353~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fb5703670aee7ec524a7f4627a1a79d49fb274c;p=platform%2Fcore%2Fuifw%2Fvoice-control.git add guard clause when use g_VoiceControlClients Change-Id: I36d7c0cccd8cee52a6948cbcf3af873e3ae950b9 --- diff --git a/common/vc_config_mgr.cpp b/common/vc_config_mgr.cpp index 23a1fd1..e502e7e 100644 --- a/common/vc_config_mgr.cpp +++ b/common/vc_config_mgr.cpp @@ -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())) {