1
0
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:
Michał W. Urbańczyk 2014-02-01 12:54:55 +00:00
parent d4fd361d4b
commit 6f8974bab3

View File

@ -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;