mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
icinga2: address comment loading where host reference is not found
address #9752: check if host reference is valid
This commit is contained in:
parent
c3b5dbfbc7
commit
ec2645d33c
@ -65,7 +65,7 @@ void Comment::OnAllConfigLoaded()
|
|||||||
|
|
||||||
Host::Ptr host = Host::GetByName(GetHostName());
|
Host::Ptr host = Host::GetByName(GetHostName());
|
||||||
|
|
||||||
if (GetServiceName().IsEmpty())
|
if (GetServiceName().IsEmpty() || ! host)
|
||||||
m_Checkable = host;
|
m_Checkable = host;
|
||||||
else
|
else
|
||||||
m_Checkable = host->GetServiceByShortName(GetServiceName());
|
m_Checkable = host->GetServiceByShortName(GetServiceName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user