Make accessing undefined variables an error (instead of a warning).

Fixes #5809
This commit is contained in:
Gunnar Beutner 2014-03-20 15:31:48 +01:00
parent cb0c1b01d5
commit 3ad233400e
1 changed files with 2 additions and 4 deletions

View File

@ -55,10 +55,8 @@ Value ScriptVariable::Get(const String& name)
{
ScriptVariable::Ptr sv = GetByName(name);
if (!sv) {
Log(LogWarning, "icinga", "Tried to access undefined variable: " + name);
return Empty;
}
if (!sv)
BOOST_THROW_EXCEPTION(std::invalid_argument("Tried to access undefined script variable '" + name + "'"));
return sv->GetData();
}