Fix possible exception when retrieving reminder

Fixes #2624
pull/20/head
Francis Lachapelle 2014-03-05 13:42:38 -05:00
parent da208d5b4a
commit 0c99323db3
2 changed files with 7 additions and 3 deletions

1
NEWS
View File

@ -10,6 +10,7 @@ Bug fixes
- fixed unsubscription when renaming an IMAP folder (#2630) - fixed unsubscription when renaming an IMAP folder (#2630)
- fixed sorting of events list by calendar name (#2629) - fixed sorting of events list by calendar name (#2629)
- fixed wrong date format leading to Android email syncing issues (#2609) - fixed wrong date format leading to Android email syncing issues (#2609)
- fixed possible exception when retrieving the default event reminder value (#2624)
2.2.0 (2014-02-24) 2.2.0 (2014-02-24)
------------------ ------------------

View File

@ -571,10 +571,13 @@ static NSArray *reminderValues = nil;
int index; int index;
value = [userDefaults calendarDefaultReminder]; value = [userDefaults calendarDefaultReminder];
index = [reminderValues indexOfObject: value]; if (value != nil)
{
index = [reminderValues indexOfObject: value];
if (index != NSNotFound) if (index != NSNotFound)
return [reminderItems objectAtIndex: index]; return [reminderItems objectAtIndex: index];
}
return @"NONE"; return @"NONE";
} }