From 309ea899ed1a63323230e4c4251ad1eb7ef6deb1 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 31 Mar 2016 11:42:52 +0200 Subject: [PATCH] Fix: Overwriting global type variables causes crash in ConfigItem::Commit() fixes #11484 --- lib/config/configitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 83d40810b..267328a8c 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -168,7 +168,8 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard) /* Make sure the type is valid. */ Type::Ptr type = Type::GetByName(GetType()); - ASSERT(type && ConfigObject::TypeInstance->IsAssignableFrom(type)); + if (!type || !ConfigObject::TypeInstance->IsAssignableFrom(type)) + BOOST_THROW_EXCEPTION(ScriptError("Type '" + GetType() + "' does not exist.", m_DebugInfo)); if (IsAbstract()) return ConfigObject::Ptr();