mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
Fix exception for Notification objects without checkable object.
Fixes #6111
This commit is contained in:
parent
07c0c9e234
commit
dbe6a20fd2
@ -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…
x
Reference in New Issue
Block a user