1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix possible nullptr dereference

This commit is contained in:
Ivan Savenko 2023-08-10 21:18:36 +03:00
parent 858f8b7c7c
commit 67b7c39761

View File

@ -189,7 +189,7 @@ void DefenceBehavior::evaluateDefence(Goals::TGoalVec & tasks, const CGTownInsta
town->getNameTranslated(),
treat.danger,
std::to_string(treat.turn),
treat.hero->getNameTranslated());
treat.hero ? treat.hero->getNameTranslated() : std::string("<no hero>"));
handleCounterAttack(town, treat, treatNode.maximumDanger, tasks);