mirror of https://github.com/Icinga/icinga2.git
Fix: Overwriting global type variables causes crash in ConfigItem::Commit()
fixes #11484
This commit is contained in:
parent
c5b7f9000d
commit
027a23f468
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue