mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-06 22:08:51 +00:00
fix(calendar): avoid exception when FoldersOrder have invalid entries
This commit is contained in:
@@ -138,13 +138,7 @@ _intValueFromHex (NSString *hexString)
|
||||
sortedFolderNames = [NSMutableArray arrayWithCapacity: max];
|
||||
for (count = max-1; count >= 0; count--)
|
||||
{
|
||||
if ([[sortedFolders objectAtIndex: count] isKindOfClass: [NSString class]])
|
||||
{
|
||||
// Calendar no longer exists; remove it from user's "FoldersOrder" setting
|
||||
dirty = YES;
|
||||
[sortedFolders removeObjectAtIndex: count];
|
||||
}
|
||||
else
|
||||
if ([[sortedFolders objectAtIndex: count] isKindOfClass: [SOGoAppointmentFolder class]])
|
||||
{
|
||||
folder = [sortedFolders objectAtIndex: count];
|
||||
folderName = [folder nameInContainer];
|
||||
@@ -153,6 +147,13 @@ _intValueFromHex (NSString *hexString)
|
||||
else
|
||||
[self errorWithFormat: @"Unexpected entry in FoldersOrder setting: %@", folder];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Calendar no longer exists; remove it from user's "FoldersOrder" setting
|
||||
[self errorWithFormat: @"Invalid folder in FoldersOrder setting: %@", [sortedFolders objectAtIndex: count]];
|
||||
dirty = YES;
|
||||
[sortedFolders removeObjectAtIndex: count];
|
||||
}
|
||||
}
|
||||
|
||||
if (dirty)
|
||||
|
||||
Reference in New Issue
Block a user