mirror of https://github.com/Icinga/icinga2.git
Make accessing undefined variables an error (instead of a warning).
Fixes #5809
This commit is contained in:
parent
cb0c1b01d5
commit
3ad233400e
|
@ -55,10 +55,8 @@ Value ScriptVariable::Get(const String& name)
|
||||||
{
|
{
|
||||||
ScriptVariable::Ptr sv = GetByName(name);
|
ScriptVariable::Ptr sv = GetByName(name);
|
||||||
|
|
||||||
if (!sv) {
|
if (!sv)
|
||||||
Log(LogWarning, "icinga", "Tried to access undefined variable: " + name);
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Tried to access undefined script variable '" + name + "'"));
|
||||||
return Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sv->GetData();
|
return sv->GetData();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue