From ee915ed5d2ad0ff99775615c497e0c835273c198 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 15 Jan 2019 19:23:20 +0100 Subject: [PATCH] Validate Zone::GetLocalZone() before using (cherry picked from commit b09e7b287e6b4bbc277c9ef7828e34f884927f82) --- lib/icinga/downtime.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index d9b24a3d3..9f0adf708 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -252,7 +252,11 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth attrs->Set("entry_time", Utility::GetTime()); if (!scheduledDowntime.IsEmpty()) { - attrs->Set("authoritative_zone", Zone::GetLocalZone()->GetName()); + auto localZone (Zone::GetLocalZone()); + + if (localZone) { + attrs->Set("authoritative_zone", localZone->GetName()); + } } Host::Ptr host; -- 2.40.0