Improve SOGoDraftObject to avoid crash when saving

pull/91/head
Francis Lachapelle 2014-12-05 21:56:54 -05:00
parent ee1f56ad27
commit 6d899008ca
1 changed files with 4 additions and 5 deletions

View File

@ -1597,17 +1597,16 @@ static NSString *userAgent = nil;
{
NSString *s, *dateString;
NGMutableHashMap *map;
NSArray *emails;
id from, replyTo;
id emails, from, replyTo;
map = [[[NGMutableHashMap alloc] initWithCapacity:16] autorelease];
/* add recipients */
if ((emails = [headers objectForKey: @"to"]) != nil)
if ((emails = [headers objectForKey: @"to"]) != nil && [emails isKindOfClass: [NSArray class]])
[map setObjects: [self _quoteSpecialsInArray: emails] forKey: @"to"];
if ((emails = [headers objectForKey: @"cc"]) != nil)
if ((emails = [headers objectForKey: @"cc"]) != nil && [emails isKindOfClass: [NSArray class]])
[map setObjects: [self _quoteSpecialsInArray: emails] forKey: @"cc"];
if ((emails = [headers objectForKey: @"bcc"]) != nil)
if ((emails = [headers objectForKey: @"bcc"]) != nil && [emails isKindOfClass: [NSArray class]])
[map setObjects: [self _quoteSpecialsInArray: emails] forKey: @"bcc"];
/* add senders */