Merge pull request #9861 from ymartin-ovh/issue-9752

icinga2: address comment loading where host reference is not found
This commit is contained in:
Julian Brost 2025-01-07 14:12:03 +01:00 committed by GitHub
commit 880632b93a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -300,6 +300,7 @@ Winfried Angele <winfried.angele@gmail.com>
Wolfgang Nieder <wnd@gmx.net>
XnS <git@xns.be>
Yannick Charton <tontonitch-pro@yahoo.fr>
Yannick Martin <yannick.martin@ovhcloud.com>
Yohan Jarosz <yohanjarosz@yahoo.fr>
Yonas Habteab <yonas.habteab@icinga.com>
Zachary McGibbon <zachary.mcgibbon@gmail.com>

View File

@ -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());