diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index ac62c1bf42a..ad12247a65f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -1089,6 +1089,11 @@ void AIGroup::friend_moveFormationToPos( const Coord3D *pos, CommandSourceType c } Object *theUnit = (*i); AIUpdateInterface *ai = theUnit->getAIUpdateInterface(); + if (ai == NULL) + { + continue; + } + Bool isDifferentFormation = false; Coord2D offset; if (isDifferentFormation) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index cf671acced3..a793feceb3f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -1094,6 +1094,11 @@ void AIGroup::friend_moveFormationToPos( const Coord3D *pos, CommandSourceType c } Object *theUnit = (*i); AIUpdateInterface *ai = theUnit->getAIUpdateInterface(); + if (ai == NULL) + { + continue; + } + Bool isDifferentFormation = false; Coord2D offset; if (isDifferentFormation) {