From 81e7164ef220483f440a7499b63710f09bd79106 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Tue, 29 Nov 2016 17:12:10 +0100 Subject: [PATCH] Fixed CID 1366401 --- AI/VCAI/VCAI.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 3b526144c..6498ad414 100644 --- a/AI/VCAI/VCAI.cpp +++ b/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);