fix #3771: Crash when kicking player

The game did not check if the user hash existed in the map before trying to remove it.
This commit is contained in:
Ted John 2016-05-29 10:56:36 +01:00
parent c946d2fb06
commit 91b7db31d1
1 changed files with 5 additions and 1 deletions

View File

@ -184,7 +184,11 @@ void NetworkUserManager::UnsetUsersOfGroup(uint8 groupId)
void NetworkUserManager::RemoveUser(const std::string &hash)
{
_usersByHash[hash]->Remove = true;
NetworkUser * networkUser = GetUserByHash(hash);
if (networkUser != nullptr)
{
networkUser->Remove = true;
}
}
NetworkUser * NetworkUserManager::GetUserByHash(const std::string &hash)