Merge pull request #10296 from Icinga/comment-loading-nullptr-deference

Address comment loading where host reference is not found gracefully
This commit is contained in:
Yonas Habteab 2025-01-13 13:17:40 +01:00 committed by GitHub
commit 14b854d891
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -296,6 +296,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());