Prechádzať zdrojové kódy

CGMonolith: fix crash on initialization here too

Arseniy Shestakov 8 rokov pred
rodič
commit
98406d127d
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      lib/mapObjects/MiscObjects.cpp

+ 3 - 0
lib/mapObjects/MiscObjects.cpp

@@ -1044,6 +1044,9 @@ TeleportChannelID CGMonolith::findMeChannel(std::vector<Obj> IDs, int SubID) con
 {
 	for(auto obj : cb->gameState()->map->objects)
 	{
+		if(!obj)
+			continue;
+
 		auto teleportObj = dynamic_cast<const CGTeleport *>(cb->getObj(obj->id));
 		if(teleportObj && vstd::contains(IDs, teleportObj->ID) && teleportObj->subID == SubID)
 			return teleportObj->channel;