]> granicus.if.org Git - icinga2/commitdiff
cluster: Make the feature checks more robust.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 13 Sep 2013 07:58:16 +0000 (09:58 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 13 Sep 2013 07:58:39 +0000 (09:58 +0200)
components/cluster/clustercomponent.cpp

index 5cf19fa84b3b62b55ac3611b089fd7ec5fac86f0..7417ac6fb933f64007e2958c87b2a7031e4ddc01 100644 (file)
@@ -1182,12 +1182,22 @@ void ClusterComponent::UpdateAuthority(void)
 
 bool ClusterComponent::SupportsChecks(void)
 {
-       return DynamicType::GetByName("CheckerComponent");
+       DynamicType::Ptr type = DynamicType::GetByName("CheckerComponent");
+
+       if (!type)
+               return false;
+
+       return !type->GetObjects().empty();
 }
 
 bool ClusterComponent::SupportsNotifications(void)
 {
-       return DynamicType::GetByName("NotificationComponent");
+       DynamicType::Ptr type = DynamicType::GetByName("NotificationComponent");
+
+       if (!type)
+               return false;
+
+       return !type->GetObjects().empty();
 }
 
 void ClusterComponent::InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) const