diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index d9778c053e..b409a304c9 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -160,10 +160,22 @@ namespace MWScript { if (const ESM::Script *scriptRecord = mStore.get().search (script.mId)) { - GlobalScriptDesc desc; - desc.mLocals.configure (*scriptRecord); + try + { + GlobalScriptDesc desc; + desc.mLocals.configure (*scriptRecord); - iter = mScripts.insert (std::make_pair (script.mId, desc)).first; + iter = mScripts.insert (std::make_pair (script.mId, desc)).first; + } + catch (const std::exception& exception) + { + std::cerr + << "Failed to add start script " << script.mId + << " because an exception has been thrown: " << exception.what() + << std::endl; + + return true; + } } else // script does not exist anymore return true;