fix for issue 769, random modes including momir do not have meta data.

This commit is contained in:
omegablast2002@yahoo.com
2011-12-10 12:56:36 +00:00
parent 83ac157ebd
commit a3e101eb9c

View File

@@ -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 <<endl;
}
file.close();
playerDeckMeta->Invalidate();
if(playerDeckMeta)
playerDeckMeta->Invalidate();
}
}