oc-calendar: Don't change event recurrence if parse failed.

get_AppointmentRecurrencePattern() can fail to parse the input data, added a check to avoid setup the recurrence pattern in that case. This should only happen when input data is incorrect.
pull/65/head
Javier Amor García 2015-02-23 15:21:16 +01:00
parent 68216a7456
commit ef6aab63c9
1 changed files with 6 additions and 0 deletions

View File

@ -81,6 +81,12 @@
blob = [mapiRecurrenceData asBinaryInMemCtx: memCtx];
pattern = get_AppointmentRecurrencePattern (memCtx, blob);
if (pattern == NULL) {
[self logWithFormat: @"Error parsing recurrence pattern. No changes in event recurrence will be done"];
return;
}
[(iCalCalendar *) parent
setupRecurrenceWithMasterEntity: self
fromRecurrencePattern: &pattern->RecurrencePattern];