From a09c000e72dbad8df3903a411b7c96219954564a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 13 Aug 2011 19:10:09 +0000 Subject: [PATCH] Monotone-Parent: ae56889949daaa81cfc557f2e59396ea0a1c9e4b Monotone-Revision: 031eaa8e565a8e094474a94e380477a15e9642ab Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-08-13T19:10:09 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Mailer/SOGoMailFolder.m | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b2ee453e..745546012 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-13 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailFolder.m + (-lookupName:inContext:acquire:): fixed a crash occurring when the + key didn't end with ".eml". + 2011-08-12 Wolfgang Sourdeau * OpenChange/MAPIStoreMailMessageTable.m diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 08fe06e61..9c96fe883 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -295,6 +295,8 @@ static NSString *defaultUserID = @"anyone"; keyLength = [key length]; [uids addObject: [key substringToIndex: keyLength - 4]]; } + else + [uids addObject: key]; } infos = (NSDictionary *) [self fetchUIDs: uids parts: SOGoMailCoreInfoKeys]; @@ -740,7 +742,7 @@ static NSString *defaultUserID = @"anyone"; inContext: (id)_ctx acquire: (BOOL) _acquire { - NSString *folderName, *fullFolderName, *className, *uid; + NSString *folderName, *fullFolderName, *className; SOGoMailAccount *mailAccount; id obj; @@ -778,8 +780,9 @@ static NSString *defaultUserID = @"anyone"; && [[self imap4Connection] doesMailboxExistAtURL: [self imap4URL]]) { obj = [SOGoMailObject objectWithName: _key inContainer: self]; - uid = [_key substringToIndex: [_key length] - 4]; - [obj setCoreInfos: [prefetchedInfos objectForKey: uid]]; + if ([_key hasSuffix: @".eml"]) + _key = [_key substringToIndex: [_key length] - 4]; + [obj setCoreInfos: [prefetchedInfos objectForKey: _key]]; } }