]> granicus.if.org Git - icinga2/commitdiff
Fix crash that might occur in a situation where icinga should not crash...
authorJohannes Meyer <johannes.meyer@netways.de>
Tue, 17 Dec 2013 15:01:33 +0000 (16:01 +0100)
committerJohannes Meyer <johannes.meyer@netways.de>
Tue, 17 Dec 2013 15:01:33 +0000 (16:01 +0100)
refs #5356

lib/icinga/service-downtime.cpp

index 313792515d3d9faaa79cb8b661d96dacb71b5712..f5dc3237c99db80013cde9f6e15b40bb3daff06e 100644 (file)
@@ -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;