From df2731bc2cc738c3409b858b00f8862b935374cf Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 1 Feb 2019 19:02:50 +0800 Subject: [PATCH] Fix possible crash --- src/network/protocols/client_lobby.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/protocols/client_lobby.cpp b/src/network/protocols/client_lobby.cpp index 04ee63857..4f55da39b 100644 --- a/src/network/protocols/client_lobby.cpp +++ b/src/network/protocols/client_lobby.cpp @@ -1275,7 +1275,10 @@ void ClientLobby::addSpectateHelperMessage() const auto& local_players = NetworkConfig::get()->getNetworkPlayers(); if (local_players.empty()) return; - DeviceConfig* dc = std::get<0>(local_players[0])->getConfiguration(); + InputDevice* id = std::get<0>(local_players[0]); + if (!id) + return; + DeviceConfig* dc = id->getConfiguration(); if (!dc) return; core::stringw left = dc->getBindingAsString(PA_STEER_LEFT);