1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Validate Zone::GetLocalZone() before using

This commit is contained in:
Alexander A. Klimov 2019-01-15 19:23:20 +01:00
parent 1c772aac54
commit b09e7b287e

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