[icinga-checkins] icinga.org: icinga2/master: Fix crash in ApiListener:: ConfigUpdateObjectAPIHandler

git at icinga.org git at icinga.org
Tue Feb 9 09:14:00 CET 2016


Module: icinga2
Branch: master
Commit: 14d805e6feb83d08134641df7e5c8f58a7a2a5c6
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=14d805e6feb83d08134641df7e5c8f58a7a2a5c6

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Tue Feb  9 09:13:43 2016 +0100

Fix crash in ApiListener::ConfigUpdateObjectAPIHandler

fixes #11006

---

 lib/remote/apilistener-configsync.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/remote/apilistener-configsync.cpp b/lib/remote/apilistener-configsync.cpp
index 89d154b..970ea4c 100644
--- a/lib/remote/apilistener-configsync.cpp
+++ b/lib/remote/apilistener-configsync.cpp
@@ -128,9 +128,11 @@ Value ApiListener::ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin
 			return Empty;
 		}
 
-		/* object was created, update its version to its origin */
+		/* object was created, update its version */
 		object = dtype->GetObject(objName);
-		object->SetVersion(objVersion, false, origin);
+
+		if (object)
+			object->SetVersion(objVersion, false, origin);
 	}
 
 	if (!object)



More information about the icinga-checkins mailing list