From b873dce7562b2be7401c046e6b659951c83ba08e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Mar 2009 20:56:29 +0000 Subject: [PATCH] Monotone-Parent: 4e07b3d1e8330e5242ff10554013fd21551394d5 Monotone-Revision: 514aa7865af81fdccddee5095cd390fb72c09412 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-03-20T20:56:29 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoUserDefaults.m | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13e3f8b63..cf576a1ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-03-20 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserDefaults.m ([SOGoUserDefaults + -jsonRepresentation]): return "{}" if values is nil (due to a DB + connection error). + * SoObjects/SOGo/SOGoUser.m ([SOGoUser -userDefaults]): ensure the values are not nil before putting them in the cache. This fixes an exception occuring for setting a nil key in a dictionary. diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 7691f2a86..41cc5818c 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -314,9 +314,15 @@ static NSString *uidColumnName = @"c_uid"; - (NSString *) jsonRepresentation { - [self fetchProfile]; + NSString *jsonRep; - return [values jsonRepresentation]; + [self fetchProfile]; + if (values) + jsonRep = [values jsonRepresentation]; + else + jsonRep = @"{}"; + + return jsonRep; } /* value access */