From 8e647aa72ae7e09eaa879039d8262a662de59f37 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 14 Oct 2020 09:16:01 +0400 Subject: [PATCH] Fix crash on saving --- apps/openmw/mwclass/container.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 807f2299b2..9befa06363 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -308,8 +308,14 @@ namespace MWClass void Container::writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const { + if (!ptr.getRefData().getCustomData()) + { + state.mHasCustomState = false; + return; + } + const ContainerCustomData& customData = ptr.getRefData().getCustomData()->asContainerCustomData(); - if (!ptr.getRefData().getCustomData() || !customData.mStore.isResolved()) + if (!customData.mStore.isResolved()) { state.mHasCustomState = false; return;