From b9c4b496e4f82593032933b476c9baf10845b9c6 Mon Sep 17 00:00:00 2001 From: Zach H Date: Sun, 9 May 2021 13:10:13 -0400 Subject: [PATCH] Fix regression from #4281 which caused crash if card was null (#4340) --- common/server_game.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/server_game.cpp b/common/server_game.cpp index 3fe21f99..97a76e8e 100644 --- a/common/server_game.cpp +++ b/common/server_game.cpp @@ -578,6 +578,10 @@ void Server_Game::unattachCards(GameEventStorage &ges, Server_Player *player) QMapIterator zoneIterator(player->getZones()); for (Server_CardZone *zone : player->getZones()) { for (Server_Card *card : zone->getCards()) { + if (card == nullptr) { + continue; + } + // Make a copy of the list because the original one gets modified during the loop QList attachedCards = card->getAttachedCards(); for (Server_Card *attachedCard : attachedCards) {