mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +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));
|
SetTypeFilter(FilterArrayToInt(GetTypes(), ~0));
|
||||||
SetStateFilter(FilterArrayToInt(GetStates(), ~0));
|
SetStateFilter(FilterArrayToInt(GetStates(), ~0));
|
||||||
|
|
||||||
GetCheckable()->AddNotification(GetSelf());
|
Checkable::Ptr obj = GetCheckable();
|
||||||
|
|
||||||
|
if (obj)
|
||||||
|
obj->AddNotification(GetSelf());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::Start(void)
|
void Notification::Start(void)
|
||||||
{
|
{
|
||||||
DynamicObject::Start();
|
DynamicObject::Start();
|
||||||
|
|
||||||
GetCheckable()->AddNotification(GetSelf());
|
Checkable::Ptr obj = GetCheckable();
|
||||||
|
|
||||||
|
if (obj)
|
||||||
|
obj->AddNotification(GetSelf());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::Stop(void)
|
void Notification::Stop(void)
|
||||||
{
|
{
|
||||||
DynamicObject::Stop();
|
DynamicObject::Stop();
|
||||||
|
|
||||||
GetCheckable()->RemoveNotification(GetSelf());
|
Checkable::Ptr obj = GetCheckable();
|
||||||
|
|
||||||
|
if (obj)
|
||||||
|
obj->RemoveNotification(GetSelf());
|
||||||
}
|
}
|
||||||
|
|
||||||
Checkable::Ptr Notification::GetCheckable(void) const
|
Checkable::Ptr Notification::GetCheckable(void) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user