Fix: Overwriting global type variables causes crash in ConfigItem::Commit()

fixes #11484
This commit is contained in:
Michael Friedrich 2016-03-31 11:42:52 +02:00 committed by Gunnar Beutner
parent 7b37bd8f41
commit 309ea899ed
1 changed files with 2 additions and 1 deletions

View File

@ -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();