From: Gunnar Beutner Date: Wed, 23 Jan 2013 09:41:38 +0000 (+0100) Subject: Throw exception for missing types. X-Git-Tag: v0.0.2~677 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c99d4b19a9bce100eaa5c4d4486f1216b3335c02;p=icinga2 Throw exception for missing types. --- diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 8690162f5..898ad53c1 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -150,6 +150,9 @@ DynamicObject::Ptr ConfigItem::Commit(void) DynamicType::Ptr dtype = DynamicType::GetByName(GetType()); + if (!dtype) + throw_exception(runtime_error("Type '" + GetType() + "' does not exist.")); + if (!dobj) dobj = dtype->GetObject(GetName());