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
parent c5b7f9000d
commit 027a23f468
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. */ /* Make sure the type is valid. */
Type::Ptr type = Type::GetByName(GetType()); 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()) if (IsAbstract())
return ConfigObject::Ptr(); return ConfigObject::Ptr();