From 027a23f46829eff9754a004b1b87e8c5dd52d95c 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 44f65b19b..03ff2596a 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();