mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-15 22:00:07 -04:00
Fix exception for Notification objects without checkable object.
Fixes #6111
This commit is contained in:
parent
07c0c9e234
commit
dbe6a20fd2
1 changed files with 12 additions and 3 deletions
|
|
@ -81,21 +81,30 @@ void Notification::OnConfigLoaded(void)
|
|||
SetTypeFilter(FilterArrayToInt(GetTypes(), ~0));
|
||||
SetStateFilter(FilterArrayToInt(GetStates(), ~0));
|
||||
|
||||
GetCheckable()->AddNotification(GetSelf());
|
||||
Checkable::Ptr obj = GetCheckable();
|
||||
|
||||
if (obj)
|
||||
obj->AddNotification(GetSelf());
|
||||
}
|
||||
|
||||
void Notification::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
GetCheckable()->AddNotification(GetSelf());
|
||||
Checkable::Ptr obj = GetCheckable();
|
||||
|
||||
if (obj)
|
||||
obj->AddNotification(GetSelf());
|
||||
}
|
||||
|
||||
void Notification::Stop(void)
|
||||
{
|
||||
DynamicObject::Stop();
|
||||
|
||||
GetCheckable()->RemoveNotification(GetSelf());
|
||||
Checkable::Ptr obj = GetCheckable();
|
||||
|
||||
if (obj)
|
||||
obj->RemoveNotification(GetSelf());
|
||||
}
|
||||
|
||||
Checkable::Ptr Notification::GetCheckable(void) const
|
||||
|
|
|
|||
Loading…
Reference in a new issue