From 3cdc1b6ddde2f053a6dd31225ed28b8db9ffe6a9 Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 6 Sep 2018 08:41:13 +0800 Subject: [PATCH] Fix crash if server lobby is NULL --- src/network/protocols/server_lobby.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/protocols/server_lobby.cpp b/src/network/protocols/server_lobby.cpp index 196799960..8d57dcfe1 100644 --- a/src/network/protocols/server_lobby.cpp +++ b/src/network/protocols/server_lobby.cpp @@ -924,8 +924,10 @@ void ServerLobby::checkIncomingConnectionRequests() const XMLNode * users_xml = result->getNode("users"); std::map keys; auto sl = m_server_lobby.lock(); - if (!sl || (sl->m_state.load() != WAITING_FOR_START_GAME && - !sl->allowJoinedPlayersWaiting())) + if (!sl) + return; + if (sl->m_state.load() != WAITING_FOR_START_GAME && + !sl->allowJoinedPlayersWaiting()) { sl->replaceKeys(keys); return;