mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-25 20:28:54 +00:00
Fix premature nil in JSON dict of UIxMailView.m
This commit is contained in:
1 parent
51c40914ae
commit
ae661a8409
1 file changed
+14
-7
@@ -226,7 +226,8 @@ static NSString *mailETag = nil;
|
|||||||
{
|
{
|
||||||
id <WOActionResults> response;
|
id <WOActionResults> response;
|
||||||
NSString *s;
|
NSString *s;
|
||||||
NSDictionary *data;
|
NSMutableDictionary *data;
|
||||||
|
NSArray *addresses;
|
||||||
SOGoMailObject *co;
|
SOGoMailObject *co;
|
||||||
UIxEnvelopeAddressFormatter *addressFormatter;
|
UIxEnvelopeAddressFormatter *addressFormatter;
|
||||||
|
|
||||||
@@ -272,12 +273,7 @@ static NSString *mailETag = nil;
|
|||||||
andString: [data jsonRepresentation]];
|
andString: [data jsonRepresentation]];
|
||||||
}
|
}
|
||||||
|
|
||||||
data = [NSDictionary dictionaryWithObjectsAndKeys:
|
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||||
[addressFormatter dictionariesForArray: [co fromEnvelopeAddresses]], @"from",
|
|
||||||
[addressFormatter dictionariesForArray: [co toEnvelopeAddresses]], @"to",
|
|
||||||
[addressFormatter dictionariesForArray: [co ccEnvelopeAddresses]], @"cc",
|
|
||||||
[addressFormatter dictionariesForArray: [co bccEnvelopeAddresses]], @"bcc",
|
|
||||||
[addressFormatter dictionariesForArray: [co replyToEnvelopeAddresses]], @"reply-to",
|
|
||||||
[self formattedDate], @"date",
|
[self formattedDate], @"date",
|
||||||
[self messageSubject], @"subject",
|
[self messageSubject], @"subject",
|
||||||
[self attachmentAttrs], @"attachmentAttrs",
|
[self attachmentAttrs], @"attachmentAttrs",
|
||||||
@@ -285,6 +281,17 @@ static NSString *mailETag = nil;
|
|||||||
[NSNumber numberWithBool: [self mailIsDraft]], @"isDraft",
|
[NSNumber numberWithBool: [self mailIsDraft]], @"isDraft",
|
||||||
[[self generateResponse] contentAsString], @"content",
|
[[self generateResponse] contentAsString], @"content",
|
||||||
nil];
|
nil];
|
||||||
|
if ((addresses = [addressFormatter dictionariesForArray: [co fromEnvelopeAddresses]]))
|
||||||
|
[data setObject: addresses forKey: @"from"];
|
||||||
|
if ((addresses = [addressFormatter dictionariesForArray: [co toEnvelopeAddresses]]))
|
||||||
|
[data setObject: addresses forKey: @"to"];
|
||||||
|
if ((addresses = [addressFormatter dictionariesForArray: [co ccEnvelopeAddresses]]))
|
||||||
|
[data setObject: addresses forKey: @"cc"];
|
||||||
|
if ((addresses = [addressFormatter dictionariesForArray: [co bccEnvelopeAddresses]]))
|
||||||
|
[data setObject: addresses forKey: @"bcc"];
|
||||||
|
if ((addresses = [addressFormatter dictionariesForArray: [co replyToEnvelopeAddresses]]))
|
||||||
|
[data setObject: addresses forKey: @"reply-to"];
|
||||||
|
|
||||||
response = [self responseWithStatus: 200
|
response = [self responseWithStatus: 200
|
||||||
andString: [data jsonRepresentation]];
|
andString: [data jsonRepresentation]];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user