From 201999c4a99866a64795aef6852f066663e79625 Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Mon, 14 Dec 2020 03:01:26 +0300 Subject: [PATCH] Make sure adjustPosition() is safe to call for any actor --- apps/openmw/mwworld/worldimp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index f59c92c6a..3756ea04b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1345,7 +1345,11 @@ namespace MWWorld moveObject(ptr, ptr.getCell(), pos.x(), pos.y(), pos.z()); if (ptr.getClass().isActor()) - mPhysics->getActor(ptr)->resetPosition(); + { + MWPhysics::Actor* actor = mPhysics->getActor(ptr); + if (actor) + actor->resetPosition(); + } } void World::fixPosition()