From a3e101eb9cf32a2451b9b913a23b9ef4a7f5fed8 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sat, 10 Dec 2011 12:56:36 +0000 Subject: [PATCH] fix for issue 769, random modes including momir do not have meta data. --- projects/mtg/src/DeckStats.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index 9bcc04c87..d13355049 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -180,7 +180,7 @@ void DeckStats::save(const std::string& filename) string playerDeckFilePath= options.profileFile( buffer); DeckManager *deckManager = DeckManager::GetInstance(); DeckMetaData *playerDeckMeta = deckManager->getDeckMetaDataByFilename(playerDeckFilePath, false); - if ( playerDeckMeta->getColorIndex() == "" ) + if (playerDeckMeta && playerDeckMeta->getColorIndex() == "" ) { StatsWrapper *stw = deckManager->getExtendedDeckStats( playerDeckMeta, MTGAllCards::getInstance(), false); manaColorIndex = stw->getManaColorIndex(); @@ -198,8 +198,8 @@ void DeckStats::save(const std::string& filename) file << "MANA:" << it->second->manaColorIndex <Invalidate(); + if(playerDeckMeta) + playerDeckMeta->Invalidate(); } }