diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index ad4fc730df..332f7e6545 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -636,6 +636,12 @@ namespace MWMechanics const MWWorld::Cell& cell = *actor.getCell()->getCell(); const ESM::Pathgrid* pathgrid = world.getStore().get().search(cell); + // Moved to a cell without a pathgrid + if (pathgrid == nullptr) + { + storage.mAllowedPositions.clear(); + return; + } const PathgridGraph& pathgridGraph = getPathGridGraph(pathgrid); const Misc::CoordinateConverter converter = Misc::makeCoordinateConverter(cell);