Explorar el Código

CGMonolith: fix crash on initialization here too

Arseniy Shestakov hace 8 años
padre
commit
98406d127d
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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;