From: Johannes Meyer Date: Tue, 17 Dec 2013 15:01:33 +0000 (+0100) Subject: Fix crash that might occur in a situation where icinga should not crash... X-Git-Tag: v0.0.6~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12d32ad719f5dc53259ed96aa1fa771b21653f33;p=icinga2 Fix crash that might occur in a situation where icinga should not crash... refs #5356 --- diff --git a/lib/icinga/service-downtime.cpp b/lib/icinga/service-downtime.cpp index 313792515..f5dc3237c 100644 --- a/lib/icinga/service-downtime.cpp +++ b/lib/icinga/service-downtime.cpp @@ -72,7 +72,9 @@ String Service::AddDowntime(const String& author, const String& comment, if (!triggeredBy.IsEmpty()) { Downtime::Ptr triggerDowntime = GetDowntimeByID(triggeredBy); - downtime->SetTriggeredByLegacyId(triggerDowntime->GetLegacyId()); + + if (triggerDowntime) + downtime->SetTriggeredByLegacyId(triggerDowntime->GetLegacyId()); } int legacy_id;