diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp index d8574db99..c04876696 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp @@ -232,7 +232,7 @@ QMap Server_Game::getPlayers() const // copies poi Server_AbstractPlayer *Server_Game::getPlayer(int id) const { auto *participant = participants.value(id); - if (!participant->isSpectator()) { + if (participant && !participant->isSpectator()) { return static_cast(participant); } else { return nullptr;