]> granicus.if.org Git - icinga2/commitdiff
Fix crash with empty ScheduledDowntime 'ranges' attribute
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 22 Apr 2016 09:00:21 +0000 (11:00 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 May 2016 09:08:20 +0000 (11:08 +0200)
fixes #11158

lib/icinga/scheduleddowntime.cpp

index c67bb10b304e3991af370cc03a3694c47d631585..4c03f45c9aee71fa968f05543411436b9d4e067f 100644 (file)
@@ -131,6 +131,9 @@ std::pair<double, double> ScheduledDowntime::FindNextSegment(void)
 
        Dictionary::Ptr ranges = GetRanges();
 
+       if (!ranges)
+               return std::make_pair(0, 0);
+
        Array::Ptr segments = new Array();
 
        Dictionary::Ptr bestSegment;