From e15c5b48e3e80dd3e91fc195decde720e5497b2f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 25 Jan 2011 22:43:39 +0000 Subject: [PATCH] - null pointer check when slots are switching in game lobby (thanks tomreyn) --- source/glest_game/network/server_interface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index c9ea38da..bea07443 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -198,7 +198,8 @@ bool ServerInterface::switchSlot(int fromPlayerIndex, int toPlayerIndex) { MutexSafeWrapper safeMutex(&serverSynchAccessor,intToStr(__LINE__)); MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[fromPlayerIndex],intToStr(__LINE__) + "_" + intToStr(fromPlayerIndex)); MutexSafeWrapper safeMutexSlot2(&slotAccessorMutexes[toPlayerIndex],intToStr(__LINE__) + "_" + intToStr(toPlayerIndex)); - if(slots[toPlayerIndex]->isConnected() == false) { + if(slots[toPlayerIndex] != NULL && slots[toPlayerIndex] != NULL && + slots[toPlayerIndex]->isConnected() == false) { slots[fromPlayerIndex]->setPlayerIndex(toPlayerIndex); slots[toPlayerIndex]->setPlayerIndex(fromPlayerIndex); ConnectionSlot *tmp = slots[toPlayerIndex];