mirror of https://github.com/Icinga/icinga2.git
Validate Zone::GetLocalZone() before using
(cherry picked from commit b09e7b287e
)
This commit is contained in:
parent
a557f47e2a
commit
ee915ed5d2
|
@ -252,7 +252,11 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth
|
||||||
attrs->Set("entry_time", Utility::GetTime());
|
attrs->Set("entry_time", Utility::GetTime());
|
||||||
|
|
||||||
if (!scheduledDowntime.IsEmpty()) {
|
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;
|
Host::Ptr host;
|
||||||
|
|
Loading…
Reference in New Issue