Skip to content
Snippets Groups Projects
Commit 2dca0375 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

misc: fix crash when getting status with unloaded plugin

If we have previously used the chathandler and it appears in the
allowDenyList but it is not loaded, we can have a crash.

Change-Id: I71fb4a94fdb074e36e535c2bc0776320eb5f51c0
parent 7d2a3215
No related branches found
No related tags found
No related merge requests found
...@@ -202,9 +202,10 @@ ChatServicesManager::getChatHandlerStatus(const std::string& accountId, const st ...@@ -202,9 +202,10 @@ ChatServicesManager::getChatHandlerStatus(const std::string& accountId, const st
std::vector<std::string> ret; std::vector<std::string> ret;
if (it != allowDenyList_.end()) { if (it != allowDenyList_.end()) {
for (const auto& chatHandlerName : it->second) for (const auto& chatHandlerName : it->second)
if (chatHandlerName.second) // We only return active ChatHandler ids if (chatHandlerName.second && handlersNameMap_.find(chatHandlerName.first) != handlersNameMap_.end()) { // We only return active ChatHandler ids
ret.emplace_back(std::to_string(handlersNameMap_.at(chatHandlerName.first))); ret.emplace_back(std::to_string(handlersNameMap_.at(chatHandlerName.first)));
} }
}
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment