diff --git a/stepmania/src/NetworkSyncServer.cpp b/stepmania/src/NetworkSyncServer.cpp index 04b0d7ca27..d1fdd2b797 100644 --- a/stepmania/src/NetworkSyncServer.cpp +++ b/stepmania/src/NetworkSyncServer.cpp @@ -816,12 +816,15 @@ void StepManiaLanServer::ServerChat(const CString& message) bool StepManiaLanServer::CheckConnection(const unsigned int clientNum) { //If there is an error close the socket. - if ( clientNum < Client.size() ) - if (Client[clientNum]->clientSocket.IsError()) - { - Disconnect(clientNum); - return false; - } + + if ( clientNum >= Client.size() ) + return false; + + if (Client[clientNum]->clientSocket.IsError()) + { + Disconnect(clientNum); + return false; + } return true; }