From b5d609586a7f450df4587b9a3a486b0a01bc0591 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sat, 20 Dec 2014 16:31:08 -0800 Subject: [PATCH] - small coverity fix --- source/glest_game/game/commander.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 7895de75..a9f10b75 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -765,7 +765,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); if(gameNetworkInterface != NULL) { ServerInterface *server = networkManager.getServerInterface(); - if(server->isClientConnected(playerIndex) == true) { + if(server != NULL && server->isClientConnected(playerIndex) == true) { MutexSafeWrapper safeMutex(server->getSlotMutex(playerIndex),CODE_AT_LINE); ConnectionSlot *slot = server->getSlot(playerIndex,false); @@ -776,6 +776,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { sleep(5); //printf("Sending nctDisconnectNetworkPlayer\n"); + server = networkManager.getServerInterface(false); if(server != NULL) { MutexSafeWrapper safeMutex2(server->getSlotMutex(playerIndex),CODE_AT_LINE); slot = server->getSlot(playerIndex,false);