- null pointer check when slots are switching in game lobby (thanks tomreyn)

This commit is contained in:
Mark Vejvoda 2011-01-25 22:43:39 +00:00
parent 52ffe988b7
commit e15c5b48e3
1 changed files with 2 additions and 1 deletions

View File

@ -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];