1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Fix possible crash on nullptr dereference

This commit is contained in:
Ivan Savenko
2024-05-10 18:31:02 +00:00
parent 26b76db6e7
commit 31401e219f

View File

@ -700,7 +700,7 @@ void CMap::resolveQuestIdentifiers()
//FIXME: move to CMapLoaderH3M
for (auto & quest : quests)
{
if (quest->killTarget != ObjectInstanceID::NONE)
if (quest && quest->killTarget != ObjectInstanceID::NONE)
quest->killTarget = questIdentifierToId[quest->killTarget.getNum()];
}
questIdentifierToId.clear();