Explorar el Código

Fixed CID 1366401

DjWarmonger hace 9 años
padre
commit
81e7164ef2
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      AI/VCAI/VCAI.cpp

+ 5 - 0
AI/VCAI/VCAI.cpp

@@ -271,6 +271,11 @@ void VCAI::heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visi
 {
 	LOG_TRACE_PARAMS(logAi, "start '%i'; obj '%s'", start % (visitedObj ? visitedObj->getObjectName() : std::string("n/a")));
 	NET_EVENT_HANDLER;
+	if (!visitedObj)
+	{
+		logAi->error("VCAI::heroVisit called for null object!"); //FIXME: how was that possible anyway and why we need check for it?
+		return;
+	}
 	if(start)
 	{
 		markObjectVisited (visitedObj);