Skip to content

Commit

Permalink
icinga2: address comment loading where host reference is not found
Browse files Browse the repository at this point in the history
address #9752: check if host reference is valid
  • Loading branch information
ymartin-ovh committed Sep 11, 2023
1 parent bba6a76 commit efdd1ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/icinga/comment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void Comment::OnAllConfigLoaded()

Host::Ptr host = Host::GetByName(GetHostName());

if (GetServiceName().IsEmpty())
if (GetServiceName().IsEmpty() || ! host)
m_Checkable = host;
else
m_Checkable = host->GetServiceByShortName(GetServiceName());
Expand Down

0 comments on commit efdd1ff

Please sign in to comment.