From 3d694a301fa6efdd29ee946da2f56f7ec19931cf Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 30 Apr 2012 13:25:54 +1200 Subject: [PATCH] If there are no instances ensure earliest_start still gets a value. --- inc/RRule-v2.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/RRule-v2.php b/inc/RRule-v2.php index aca9dfbc..4a2058b7 100644 --- a/inc/RRule-v2.php +++ b/inc/RRule-v2.php @@ -1481,6 +1481,11 @@ function getVCalendarRange( $vResource ) { foreach ( rdate_expand($dtstart, 'EXDATE', $comp, $range_end) AS $k => $v ) { unset($instances[$k]); } + if ( count($instances) < 1 ) { + if ( empty($earliest_start) || $dtstart < $earliest_start ) $earliest_start = $dtstart; + $latest_end = null; + break; + } $instances = array_keys($instances); asort($instances); $first = new RepeatRuleDateTime($instances[0]);