mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix for #1673 — objects vector may contain nullptr (for objects that have been removed).
This commit is contained in:
parent
d4fd361d4b
commit
6f8974bab3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user