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