- null pointer check when slots are switching in game lobby (thanks tomreyn)
This commit is contained in:
parent
52ffe988b7
commit
e15c5b48e3
|
@ -198,7 +198,8 @@ bool ServerInterface::switchSlot(int fromPlayerIndex, int toPlayerIndex) {
|
||||||
MutexSafeWrapper safeMutex(&serverSynchAccessor,intToStr(__LINE__));
|
MutexSafeWrapper safeMutex(&serverSynchAccessor,intToStr(__LINE__));
|
||||||
MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[fromPlayerIndex],intToStr(__LINE__) + "_" + intToStr(fromPlayerIndex));
|
MutexSafeWrapper safeMutexSlot(&slotAccessorMutexes[fromPlayerIndex],intToStr(__LINE__) + "_" + intToStr(fromPlayerIndex));
|
||||||
MutexSafeWrapper safeMutexSlot2(&slotAccessorMutexes[toPlayerIndex],intToStr(__LINE__) + "_" + intToStr(toPlayerIndex));
|
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[fromPlayerIndex]->setPlayerIndex(toPlayerIndex);
|
||||||
slots[toPlayerIndex]->setPlayerIndex(fromPlayerIndex);
|
slots[toPlayerIndex]->setPlayerIndex(fromPlayerIndex);
|
||||||
ConnectionSlot *tmp = slots[toPlayerIndex];
|
ConnectionSlot *tmp = slots[toPlayerIndex];
|
||||||
|
|
Loading…
Reference in New Issue