]> granicus.if.org Git - icinga2/commitdiff
ApiListener: Bail out if object could not be created during config sync
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 12 Feb 2016 13:11:50 +0000 (14:11 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 12 Feb 2016 13:15:24 +0000 (14:15 +0100)
refs #11006

lib/remote/apilistener-configsync.cpp

index 3512114e35442244a11a5e9fd10e958b5ef189f3..189f705990091557aaa60c41bc53ad504f8b0b19 100644 (file)
@@ -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)