Catch exception from invalid scripts during save&load (Fixes #1590)

This commit is contained in:
scrawl 2014-06-29 14:45:52 +02:00
parent b5650f5d4f
commit 1de406cb6d

View file

@ -5,6 +5,7 @@
#include <components/esm/locals.hpp> #include <components/esm/locals.hpp>
#include <components/compiler/locals.hpp> #include <components/compiler/locals.hpp>
#include <components/compiler/exception.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/scriptmanager.hpp" #include "../mwbase/scriptmanager.hpp"
@ -74,6 +75,8 @@ namespace MWScript
} }
void Locals::write (ESM::Locals& locals, const std::string& script) const void Locals::write (ESM::Locals& locals, const std::string& script) const
{
try
{ {
const Compiler::Locals& declarations = const Compiler::Locals& declarations =
MWBase::Environment::get().getScriptManager()->getLocals(script); MWBase::Environment::get().getScriptManager()->getLocals(script);
@ -106,8 +109,14 @@ namespace MWScript
} }
} }
} }
catch (const Compiler::SourceException&)
{
}
}
void Locals::read (const ESM::Locals& locals, const std::string& script) void Locals::read (const ESM::Locals& locals, const std::string& script)
{
try
{ {
const Compiler::Locals& declarations = const Compiler::Locals& declarations =
MWBase::Environment::get().getScriptManager()->getLocals(script); MWBase::Environment::get().getScriptManager()->getLocals(script);
@ -136,4 +145,8 @@ namespace MWScript
} }
} }
} }
catch (const Compiler::SourceException&)
{
}
}
} }