diff --git a/src/strategy/Value.cpp b/src/strategy/Value.cpp index 0d5f064f..a9067b31 100644 --- a/src/strategy/Value.cpp +++ b/src/strategy/Value.cpp @@ -53,8 +53,13 @@ CDPairCalculatedValue::CDPairCalculatedValue(PlayerbotAI* botAI, std::string con std::string const CDPairCalculatedValue::Format() { CreatureData const* creatureData = Calculate(); - CreatureTemplate const* bmTemplate = sObjectMgr->GetCreatureTemplate(creatureData->id1); - return bmTemplate ? bmTemplate->Name : ""; + if (creatureData) + { + CreatureTemplate const* bmTemplate = sObjectMgr->GetCreatureTemplate(creatureData->id1); + return bmTemplate ? bmTemplate->Name : ""; + } + + return ""; } CDPairListCalculatedValue::CDPairListCalculatedValue(PlayerbotAI* botAI, std::string const name, int32 checkInterval) :