Prevent allocate memory if player doesn't exists

This commit is contained in:
Koncord 2017-01-10 18:31:51 +08:00
parent 97dd8704a3
commit 32615d05cf

View file

@ -52,6 +52,8 @@ void Players::newPlayer(RakNet::RakNetGUID guid)
Player *Players::getPlayer(RakNet::RakNetGUID guid)
{
if(players.count(guid) == 0)
return nullptr;
return players[guid];
}