(fix) avoid exceptions for RRULE with no DTSTART

This commit is contained in:
Ludovic Marcotte
2019-09-03 13:34:35 -04:00
parent 3065783c2c
commit e4ad088f0d
5 changed files with 20 additions and 1 deletions

1
NEWS
View File

@@ -20,6 +20,7 @@ Bug fixes
- [core] honor IMAPLoginFieldName also when setting IMAP ACLs
- [core] honor groups when setting IMAP ACLs
- [core] honor "any authenticated user" when setting IMAP ACLs
- [core] avoid exceptions for RRULE with no DTSTART
4.0.8 (2019-07-19)
------------------

View File

@@ -69,6 +69,10 @@
dayMask = nil;
repeatCount = 0;
if (!firstRange)
// Can happen when event/todo has a rrule with no dtstart
return nil;
if ([endDate compare: firStart] == NSOrderedAscending)
// Range ends before first occurrence
return nil;

View File

@@ -79,6 +79,10 @@
repeatCount = 0;
hasRepeatCount = [rrule hasRepeatCount];
if (!firstRange)
// Can happen when event/todo has a rrule with no dtstart
return nil;
if ([endDate compare: firStart] == NSOrderedAscending)
// Range ends before first occurrence
return nil;

View File

@@ -59,7 +59,11 @@
repeatCount = 0;
count = 0;
referenceDate = nil;
if (!firstRange)
// Can happen when event/todo has a rrule with no dtstart
return nil;
if ([rEnd compare: firStart] == NSOrderedAscending)
// Range ends before first occurrence
return nil;

View File

@@ -1100,6 +1100,12 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
endDate = [(iCalToDo*) component due];
}
if (![master startDate])
{
[self errorWithFormat: @"ignored component with no DTSTART"];
return;
}
delta = [masterEndDate timeIntervalSinceDate: [master startDate]];
recurrenceIdRange = [NGCalendarDateRange calendarDateRangeWithStartDate: recurrenceId
endDate: [recurrenceId dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds: delta]];