]> granicus.if.org Git - icinga2/commitdiff
Fix crash in Service::IsReachable().
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 28 Feb 2013 09:26:33 +0000 (10:26 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 28 Feb 2013 09:26:33 +0000 (10:26 +0100)
lib/icinga/service.cpp

index f8fdcb059fed093ac782da992e870a2472e414d1..a951df8284638048044ffd55bfef62f5970b8715 100644 (file)
@@ -191,6 +191,11 @@ bool Service::IsReachable(const Service::Ptr& self)
 
        BOOST_FOREACH(const Host::Ptr& host, Service::GetParentHosts(self)) {
                Service::Ptr hc = Host::GetHostCheckService(host);
+
+               /* ignore hosts that don't have a hostcheck */
+               if (!hc)
+                       continue;
+
                ObjectLock olock(hc);
 
                /* ignore ourselves */