diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 57bd9bca84..60f7bd4276 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -3314,6 +3314,9 @@ Object *PartitionManager::getClosestObjects( for (CellAndObjectIntersection *thisCoi = thisCell->getFirstCoiInCell(); thisCoi; thisCoi = thisCoi->getNextCoi()) { PartitionData *thisMod = thisCoi->getModule(); + if (thisMod == nullptr) + continue; + Object *thisObj = thisMod->getObject(); // never compare against ourself. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 91b5ffb9e6..66d1169299 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -3321,6 +3321,9 @@ Object *PartitionManager::getClosestObjects( for (CellAndObjectIntersection *thisCoi = thisCell->getFirstCoiInCell(); thisCoi; thisCoi = thisCoi->getNextCoi()) { PartitionData *thisMod = thisCoi->getModule(); + if (thisMod == nullptr) + continue; + Object *thisObj = thisMod->getObject(); // never compare against ourself.