diff --git a/lib/icinga/checkable-dependency.cpp b/lib/icinga/checkable-dependency.cpp index 213031eb9..b66ddc70d 100644 --- a/lib/icinga/checkable-dependency.cpp +++ b/lib/icinga/checkable-dependency.cpp @@ -109,7 +109,7 @@ std::set Checkable::GetParents(void) const BOOST_FOREACH(const Dependency::Ptr& dep, GetDependencies()) { Checkable::Ptr parent = dep->GetParent(); - if (parent) + if (parent && parent.get() != this) parents.insert(parent); } @@ -123,7 +123,7 @@ std::set Checkable::GetChildren(void) const BOOST_FOREACH(const Dependency::Ptr& dep, GetReverseDependencies()) { Checkable::Ptr service = dep->GetChild(); - if (service) + if (service && service.get() != this) parents.insert(service); }