1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:23:54 +00:00

Merge pull request #3012 from akortunov/container_crash

Fix crash on saving
This commit is contained in:
Bret Curtis 2020-10-14 12:43:31 +02:00 committed by GitHub
commit 425fa837d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,8 +308,14 @@ namespace MWClass
void Container::writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const 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(); const ContainerCustomData& customData = ptr.getRefData().getCustomData()->asContainerCustomData();
if (!ptr.getRefData().getCustomData() || !customData.mStore.isResolved()) if (!customData.mStore.isResolved())
{ {
state.mHasCustomState = false; state.mHasCustomState = false;
return; return;