Bugfix: null derefence in Service::ApplyCheckResult.

This commit is contained in:
Gunnar Beutner 2013-01-27 11:49:23 +01:00
parent ce49e3856b
commit e10d4f6b8b
1 changed files with 10 additions and 6 deletions

View File

@ -517,13 +517,17 @@ void Service::ApplyCheckResult(const Dictionary::Ptr& cr)
}
/* reschedule dependencies */
String svc;
BOOST_FOREACH(tie(tuples::ignore, svc), GetDependencies()) {
if (!Service::Exists(svc))
continue;
Dictionary::Ptr dependencies = GetDependencies();
Service::Ptr service = Service::GetByName(svc);
service->SetNextCheck(Utility::GetTime());
if (dependencies) {
String svc;
BOOST_FOREACH(tie(tuples::ignore, svc), dependencies) {
if (!Service::Exists(svc))
continue;
Service::Ptr service = Service::GetByName(svc);
service->SetNextCheck(Utility::GetTime());
}
}
}
}