diff --git a/ChangeLog b/ChangeLog index a9b04a449..921f052d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-11-08 Wolfgang Sourdeau + + * OpenChange/MAPIStoreRecurrenceUtils.m + (-fillRecurrencePattern:withStartDate:andEndDate:): fixed a crash + occurring when no byday mask was specified. We also force a value + for the monthday in the case of a yearly event without a proper + one. + 2011-11-07 Wolfgang Sourdeau * OpenChange/MAPIStoreFolder.m (-addProperties:): we now override diff --git a/OpenChange/MAPIStoreRecurrenceUtils.m b/OpenChange/MAPIStoreRecurrenceUtils.m index 7f283b698..de279b4fe 100644 --- a/OpenChange/MAPIStoreRecurrenceUtils.m +++ b/OpenChange/MAPIStoreRecurrenceUtils.m @@ -305,6 +305,14 @@ rp->FirstDateTime = [moduloDate asMinutesSince1601]; byMonthDay = [[self byMonthDay] objectAtIndex: 0]; + if (!byMonthDay && (freq == iCalRecurrenceFrequenceYearly)) + { + byMonthDay = [NSString stringWithFormat: @"%d", [startDate dayOfMonth]]; + [self warnWithFormat: @"no month day specified in yearly" + @" recurrence: we deduce it from the start date: %@", + byMonthDay]; + } + if (byMonthDay) { if ([byMonthDay intValue] < 0) @@ -325,11 +333,14 @@ { rp->PatternType = PatternType_MonthNth; byDayMask = [self byDayMask]; - days = [byDayMask weekDayOccurrences]; mask = 0; - for (count = 0; count < 7; count++) - if (days[0][count]) - mask |= 1 << count; + days = [byDayMask weekDayOccurrences]; + if (days) + { + for (count = 0; count < 7; count++) + if (days[0][count]) + mask |= 1 << count; + } if (mask) { rp->PatternTypeSpecific.MonthRecurrencePattern.WeekRecurrencePattern = mask;