diff --git a/components/esm3/globalscript.cpp b/components/esm3/globalscript.cpp index c101d92719..935bf35857 100644 --- a/components/esm3/globalscript.cpp +++ b/components/esm3/globalscript.cpp @@ -19,7 +19,11 @@ namespace ESM mTargetId = esm.getHNORefId("TARG"); if (esm.peekNextSub("FRMR")) mTargetRef = esm.getFormId(true, "FRMR"); - esm.applyContentFileMapping(mTargetRef); + if (!esm.applyContentFileMapping(mTargetRef)) + { + mTargetId = ESM::RefId(); + mTargetRef = ESM::FormId(); + } } void GlobalScript::save(ESMWriter& esm) const