LogManager: Check if listener is valid before using it

This commit is contained in:
Léo Lam
2017-06-17 10:39:06 +02:00
parent a2ad3e14d0
commit dd8dcdf880
2 changed files with 3 additions and 2 deletions

View File

@ -164,7 +164,8 @@ void LogManager::LogWithFullPath(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE
LogTypes::LOG_LEVEL_TO_CHAR[(int)level], log->GetShortName().c_str(), temp);
for (auto listener_id : *log)
m_listeners[listener_id]->Log(level, msg.c_str());
if (m_listeners[listener_id])
m_listeners[listener_id]->Log(level, msg.c_str());
}
void LogManager::Init()