diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index a6e26199a..e7827492f 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -287,6 +287,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) {