cluster: Make the feature checks more robust.

This commit is contained in:
Gunnar Beutner 2013-09-13 09:58:16 +02:00
parent 2d991703d6
commit 8c7d50eef3
1 changed files with 12 additions and 2 deletions

View 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