forked from teamnwah/openmw-tes3coop
Prevent allocate memory if player doesn't exists
This commit is contained in:
parent
97dd8704a3
commit
32615d05cf
1 changed files with 2 additions and 0 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue