diff --git a/ChangeLog b/ChangeLog index 11f9fae3a..a79f5dc96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-03 Wolfgang Sourdeau + + * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults + -primaryFetchProfile]): the values returned from the database are + converted to a put dictionary first, since the dictionary returned + is actually an immutable one, which can cause a crash afterwards. + 2007-04-27 Wolfgang Sourdeau * SoObjects/SOGo/SOGoPermissions.m: added "SOGoRole_ObjectViewer" diff --git a/SoObjects/SOGo/AgenorUserDefaults.m b/SoObjects/SOGo/AgenorUserDefaults.m index 1069645b7..ff553d75d 100644 --- a/SoObjects/SOGo/AgenorUserDefaults.m +++ b/SoObjects/SOGo/AgenorUserDefaults.m @@ -104,7 +104,7 @@ static NSString *uidColumnName = @"uid"; { GCSChannelManager *cm; EOAdaptorChannel *channel; - NSDictionary *row; + NSDictionary *row, *oldValues; NSException *ex; NSString *sql; NSArray *attrs; @@ -122,15 +122,15 @@ static NSString *uidColumnName = @"uid"; @" WHERE %@ = '%@'"), fieldName, [[self tableURL] gcsTableName], uidColumnName, [self uid]]; - + + [values release]; + values = [NSMutableDictionary new]; + /* run SQL */ ex = [channel evaluateExpressionX: sql]; if (ex) - { - [self errorWithFormat:@"could not run SQL '%@': %@", sql, ex]; - values = [NSMutableDictionary new]; - } + [self errorWithFormat:@"could not run SQL '%@': %@", sql, ex]; else { /* fetch schema */ @@ -142,14 +142,10 @@ static NSString *uidColumnName = @"uid"; [channel cancelFetch]; /* remember values */ - [values release]; - values = [[row objectForKey: fieldName] propertyList]; - if (values) - [values retain]; - else - values = [NSMutableDictionary new]; + oldValues = [[row objectForKey: fieldName] propertyList]; + [values setDictionary: oldValues]; - ASSIGN(lastFetch, [NSCalendarDate date]); + ASSIGN (lastFetch, [NSCalendarDate date]); defFlags.modified = NO; rc = YES; }