diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 76df2b304..674b127ef 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -405,8 +405,11 @@ void Networking::NewPlayer(RakNet::RakNetGUID guid) void Networking::DisconnectPlayer(RakNet::RakNetGUID guid) { - Script::Call(Players::GetPlayer(guid)->GetID()); - controller->GetPacket(ID_USER_DISCONNECTED)->Send(Players::GetPlayer(guid), true); + Player *player = Players::GetPlayer(guid); + if(!player) + return; + Script::Call(player->GetID()); + controller->GetPacket(ID_USER_DISCONNECTED)->Send(player, true); Players::DeletePlayer(guid); }