1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Fix crash when trying to set field on a value that is not an object

fixes 
This commit is contained in:
Gunnar Beutner 2015-07-30 08:28:07 +02:00
parent b1d7bf9dde
commit e9c2214837

@ -255,6 +255,9 @@ public:
static inline void SetField(const Object::Ptr& context, const String& field, const Value& value, const DebugInfo& debugInfo = DebugInfo())
{
if (!context)
BOOST_THROW_EXCEPTION(ScriptError("Cannot set field '" + field + "' on a value that is not an object.", debugInfo));
Dictionary::Ptr dict = dynamic_pointer_cast<Dictionary>(context);
if (dict) {