From 6e6ca0394bcf2d9e47fadf969e6c548feef22030 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Mon, 29 Nov 2010 00:36:38 +0000 Subject: [PATCH] seperated an if( statement that was causing a crash in deck editor when you used the "unlock cards" cheat. this->needsUpdate is actually a Null Pointer at the time its checked, so having it checked in the same if ( would instantly cause the game to crash. Issue: 536 --- projects/mtg/src/DeckStats.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index f3fcac6af..0d704ff5b 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -260,7 +260,11 @@ void StatsWrapper::updateStats(string filename, MTGAllCards *collection) void StatsWrapper::updateStats(DeckDataWrapper *myDeck) { - if (!this->needUpdate || !myDeck) return; + if (!myDeck) + { + return; + } + if (!this->needUpdate) return; this->needUpdate = false; this->cardCount = myDeck->getCount(WSrcDeck::UNFILTERED_COPIES); this->countLands = myDeck->getCount(Constants::MTG_COLOR_LAND);