From 5e924508773b71e9df3fe032b73f3a7359e7752d Mon Sep 17 00:00:00 2001 From: Yannick Martin Date: Mon, 11 Sep 2023 16:29:15 +0200 Subject: [PATCH] icinga2: address comment loading where host reference is not found address #9752: check if host reference is valid --- lib/icinga/comment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icinga/comment.cpp b/lib/icinga/comment.cpp index 9c0b92359..846735262 100644 --- a/lib/icinga/comment.cpp +++ b/lib/icinga/comment.cpp @@ -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());