Avoid fatal errors in case the event object has invalid date properties

This commit is contained in:
Thomas Bruederli 2014-01-15 16:32:34 +01:00
parent cbbcba9a2d
commit b0e06ccdb7

View file

@ -118,7 +118,7 @@ class kolab_date_recurrence
} }
// determine a reasonable end date if none given // determine a reasonable end date if none given
if (!$event['recurrence']['COUNT']) { if (!$event['recurrence']['COUNT'] && $event['start'] instanceof DateTime) {
switch ($event['recurrence']['FREQ']) { switch ($event['recurrence']['FREQ']) {
case 'YEARLY': $intvl = 'P100Y'; break; case 'YEARLY': $intvl = 'P100Y'; break;
case 'MONTHLY': $intvl = 'P20Y'; break; case 'MONTHLY': $intvl = 'P20Y'; break;