Crash safely with an error when sphrase is missing on client

This commit is contained in:
kaetemi 2014-05-23 19:13:36 +02:00
parent b38468036d
commit ebb20fe86c

View file

@ -4513,7 +4513,9 @@ uint32 CSPhraseManager::getTotalActionMalus(const CSPhraseCom &phrase) const
if (!phrase.Bricks.empty())
{
CSBrickSheet *rootBrick = pBM->getBrick(phrase.Bricks[0]);
if(actMalus && !rootBrick->isSpecialPower())
if (!rootBrick)
nlerror("Invalid root sbrick in sphrase_com '%s'", phrase.Name.toUtf8().c_str());
else if (actMalus && !rootBrick->isSpecialPower())
totalActionMalus = actMalus->getValue32();
}
return totalActionMalus;