From 3af57f0858d75d8423f48d5133d85e51261065c5 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 15 Apr 2022 22:23:53 +0300 Subject: [PATCH] [Client] Fix crash when creating Cell from base Cell lacking Pathgrid --- apps/openmw/mwmp/RecordHelper.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmp/RecordHelper.cpp b/apps/openmw/mwmp/RecordHelper.cpp index 8f67b71ff..312cf4e7e 100644 --- a/apps/openmw/mwmp/RecordHelper.cpp +++ b/apps/openmw/mwmp/RecordHelper.cpp @@ -373,9 +373,13 @@ void RecordHelper::overrideRecord(const mwmp::CellRecord& record) // Note: This has to be done after the new Cell has been created so the Pathgrid override // can correctly determine whether the Cell is an interior or an exterior const ESM::Pathgrid* basePathgrid = world->getStore().get().search(record.baseId); - ESM::Pathgrid finalPathgrid = *basePathgrid; - finalPathgrid.mCell = recordData.mName; - world->getModifiableStore().overrideRecord(finalPathgrid); + + if (basePathgrid) + { + ESM::Pathgrid finalPathgrid = *basePathgrid; + finalPathgrid.mCell = recordData.mName; + world->getModifiableStore().overrideRecord(finalPathgrid); + } } else {