From: Alexander A. Klimov Date: Tue, 15 Jan 2019 18:23:20 +0000 (+0100) Subject: Validate Zone::GetLocalZone() before using X-Git-Tag: v2.10.3~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee915ed5d2ad0ff99775615c497e0c835273c198;p=icinga2 Validate Zone::GetLocalZone() before using (cherry picked from commit b09e7b287e6b4bbc277c9ef7828e34f884927f82) --- 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;