From: Michael Friedrich Date: Fri, 12 Feb 2016 13:11:50 +0000 (+0100) Subject: ApiListener: Bail out if object could not be created during config sync X-Git-Tag: v2.5.0~532 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8a9f456975b4435adf287c76a1a86e56ca7aaa0;p=icinga2 ApiListener: Bail out if object could not be created during config sync refs #11006 --- diff --git a/lib/remote/apilistener-configsync.cpp b/lib/remote/apilistener-configsync.cpp index 3512114e3..189f70599 100644 --- a/lib/remote/apilistener-configsync.cpp +++ b/lib/remote/apilistener-configsync.cpp @@ -128,11 +128,13 @@ Value ApiListener::ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin return Empty; } - /* object was created, update its version */ object = dtype->GetObject(objName); - if (object) - object->SetVersion(objVersion, false, origin); + if (!object) + return Empty; + + /* object was created, update its version */ + object->SetVersion(objVersion, false, origin); } if (!object)