Fix possible crash

This commit is contained in:
Benau 2019-02-01 19:02:50 +08:00
parent 6ac98c0324
commit df2731bc2c

View File

@ -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);