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]]; } }