From 6f8974bab3869b16cd1fe1bb0f9236ba8d1c95a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Sat, 1 Feb 2014 12:54:55 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20for=20#1673=20=E2=80=94=20objects=20vecto?= =?UTF-8?q?r=20may=20contain=20nullptr=20(for=20objects=20that=20have=20be?= =?UTF-8?q?en=20removed).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mapping/CMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mapping/CMap.cpp b/lib/mapping/CMap.cpp index 1ec8789c1..de58a6ae3 100644 --- a/lib/mapping/CMap.cpp +++ b/lib/mapping/CMap.cpp @@ -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;