Fix crash in Downtime::DowntimesExpireTimerHandler

fixes #11534
fixes #11559
This commit is contained in:
Gunnar Beutner 2016-04-12 12:04:38 +02:00
parent 2d7f6ab484
commit 974ca9f38b
3 changed files with 5 additions and 2 deletions

View File

@ -244,7 +244,7 @@ void Comment::CommentsExpireTimerHandler(void)
} }
BOOST_FOREACH(const Comment::Ptr& comment, comments) { BOOST_FOREACH(const Comment::Ptr& comment, comments) {
if (comment->IsExpired()) if (comment->IsActive() && comment->IsExpired())
RemoveComment(comment->GetName()); RemoveComment(comment->GetName());
} }
} }

View File

@ -358,7 +358,7 @@ void Downtime::DowntimesExpireTimerHandler(void)
} }
BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) { BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
if (downtime->IsExpired()) if (downtime->IsActive() && downtime->IsExpired())
RemoveDowntime(downtime->GetName(), false, true); RemoveDowntime(downtime->GetName(), false, true);
} }
} }

View File

@ -72,6 +72,9 @@ void NotificationComponent::NotificationTimerHandler(void)
double now = Utility::GetTime(); double now = Utility::GetTime();
BOOST_FOREACH(const Notification::Ptr& notification, ConfigType::GetObjectsByType<Notification>()) { BOOST_FOREACH(const Notification::Ptr& notification, ConfigType::GetObjectsByType<Notification>()) {
if (!notification->IsActive())
continue;
Checkable::Ptr checkable = notification->GetCheckable(); Checkable::Ptr checkable = notification->GetCheckable();
if (checkable->IsPaused() && GetEnableHA()) if (checkable->IsPaused() && GetEnableHA())