diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 72af6b14..5d1b93d8 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -674,9 +674,11 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr clien // A player left the game. GamePlayerLeft_t *netLeft = &netGamePlayer->gamePlayerNotification.choice.gamePlayerLeft; - boost::shared_ptr tmpPlayer = client->GetGame()->getPlayerByUniqueId(netLeft->playerId); - if (tmpPlayer) { - tmpPlayer->setIsKicked(netLeft->gamePlayerLeftReason == gamePlayerLeftReason_leftKicked); + if (client->GetGame()) { + boost::shared_ptr tmpPlayer = client->GetGame()->getPlayerByUniqueId(netLeft->playerId); + if (tmpPlayer) { + tmpPlayer->setIsKicked(netLeft->gamePlayerLeftReason == gamePlayerLeftReason_leftKicked); + } } // Signal to GUI and remove from data list. client->RemovePlayerData(netLeft->playerId, netLeft->gamePlayerLeftReason);