From ac8cf16885b1c42775793abd09a04601fdb2cf42 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 29 Jan 2016 10:03:56 -0500 Subject: [PATCH] (fix) Safeguard againts mailboxes with no quota Fixes #3468 --- UI/MailerUI/UIxMailFolderActions.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 7a7ca33a5..183c3ee8b 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -684,6 +684,8 @@ NSURL *currentURL; NSDictionary *data; + id quota; + co = [self clientObject]; error = [co addFlagsToAllMessages: @"deleted"]; @@ -712,8 +714,14 @@ { // We return the inbox quota account = [co mailAccountFolder]; - data = [NSDictionary dictionaryWithObject: [account getInboxQuota] forKey: @"quotas"]; - response = [self responseWithStatus: 200 andJSONRepresentation: data]; + if ((quota = [account getInboxQuota])) + { + data = [NSDictionary dictionaryWithObjectsAndKeys: quota, @"quotas", nil]; + response = [self responseWithStatus: 200 + andString: [data jsonRepresentation]]; + } + else + response = [self responseWithStatus: 200]; } return response;