From 465d05f5a01c78c072204f2848ed244e1e143115 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 4 Jan 2026 21:54:10 -0800 Subject: [PATCH] [ServerGame] null check participant in getPlayer --- .../libcockatrice/network/server/remote/game/server_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;