From e9c22148376c27ac0d01f12488d76c1ba427ae94 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 30 Jul 2015 08:28:07 +0200 Subject: [PATCH] Fix crash when trying to set field on a value that is not an object fixes #9779 --- lib/config/vmops.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index 96449c9c1..1db10e009 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -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(context); if (dict) { -- 2.40.0