diff --git a/ChangeLog b/ChangeLog index 5f0d9100c..c33e549c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ * Updated the Mobile Device Configuration Guide in order to document the iPhone OS 3.x configuration settings (iPhone / iPod) + * UI/Scheduler/UIxComponentEditor.m (_handleCustomRRule:) + Improved the robustness of the code. 2009-10-24 Ludovic Marcotte diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 21e632f1c..8970c29b9 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -1639,22 +1639,23 @@ RANGE(2); // case 0: { - if ([[self repeat2] intValue] > 0) + [theRule setFrequency: iCalRecurrenceFrequenceDaily]; + + if ([[self repeat1] intValue] > 0) { - [theRule setFrequency: iCalRecurrenceFrequenceDaily]; - - if ([[self repeat1] intValue] == 0) - { - [theRule setInterval: [self repeat2]]; - } - else - { - [theRule setByDayMask: (iCalWeekDayMonday - |iCalWeekDayTuesday - |iCalWeekDayWednesday - |iCalWeekDayThursday - |iCalWeekDayFriday)]; - } + [theRule setByDayMask: (iCalWeekDayMonday + |iCalWeekDayTuesday + |iCalWeekDayWednesday + |iCalWeekDayThursday + |iCalWeekDayFriday)]; + } + else + { + // Make sure we haven't received any junk.... + if ([[self repeat2] intValue] < 1) + [self setRepeat2: @"1"]; + + [theRule setInterval: [self repeat2]]; } } break;