From 5fb5703670aee7ec524a7f4627a1a79d49fb274c Mon Sep 17 00:00:00 2001 From: ulgal-park Date: Mon, 13 Mar 2023 12:54:05 +0900 Subject: [PATCH] add guard clause when use g_VoiceControlClients Change-Id: I36d7c0cccd8cee52a6948cbcf3af873e3ae950b9 --- common/vc_config_mgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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())) { -- 2.34.1