mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fix for #1673 — objects vector may contain nullptr (for objects that have been removed).
This commit is contained in:
@@ -321,7 +321,7 @@ const CGObjectInstance * CMap::getObjectiveObjectFrom(int3 pos, Obj::EObj type)
|
||||
CGObjectInstance * bestMatch = nullptr;
|
||||
for (CGObjectInstance * object : objects)
|
||||
{
|
||||
if (object->ID == type)
|
||||
if (object && object->ID == type)
|
||||
{
|
||||
if (bestMatch == nullptr)
|
||||
bestMatch = object;
|
||||
|
Reference in New Issue
Block a user