From 43ef41eeb70b65cd15b22230c6eeb542ac40e664 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 11 Aug 2010 13:31:59 +0000 Subject: [PATCH] Monotone-Parent: cbf125640f6348895aa302fdfc58f2a13c96cc80 Monotone-Revision: 9f129d083b11ce7ac964a083c351d2a15f16fbdb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-11T13:31:59 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Common/UIxPageFrame.m | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad42d4bd8..8d4fbf086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-08-11 Wolfgang Sourdeau + + * UI/Common/UIxPageFrame.m (_dictionaryWithKeys:fromSource:): + set an NSNull as value for keys which return no results, in order + to avoid an NSInvalidArgumentException. + 2010-08-09 Wolfgang Sourdeau * UI/WebServerResources/MailerUI.js (openMailbox): removed the diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index e7dddc636..9e33be5c9 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -21,6 +21,7 @@ */ #import +#import #import #import @@ -465,6 +466,10 @@ NSString *key; int count, max; NSMutableDictionary *dict; + NSNull *nsNull; + id value; + + nsNull = [NSNull null]; max = [keys count]; @@ -472,8 +477,10 @@ for (count = 0; count < max; count++) { key = [keys objectAtIndex: count]; - [dict setObject: [source objectForKey: key] - forKey: key]; + value = [source objectForKey: key]; + if (!value) + value = nsNull; + [dict setObject: value forKey: key]; } return [dict jsonRepresentation];