* Source/NSUserDefaultsController.m

([GSUserDefaultsHelper-valueForKey:]) Use a marker for values
  being nil. This should fix bug #34790.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34167 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-11-13 16:43:26 +00:00
parent 3ace7a7cf7
commit 7b7ec00dba
2 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-11-13 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSUserDefaultsController.m
([GSUserDefaultsHelper-valueForKey:]) Use a marker for values
being nil. This should fix bug #34790.
2011-11-11 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImage.m (-bestRepresentationForDevice:): When

View file

@ -31,6 +31,7 @@
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSKeyValueObserving.h>
#import <Foundation/NSNotification.h>
#import <Foundation/NSNull.h>
#import <Foundation/NSUserDefaults.h>
#import "AppKit/NSUserDefaultsController.h"
@ -87,7 +88,19 @@ static id shared = nil;
// We need to cache the values we return to be able to
// report changes to them when the defaults change.
if (value)
[values setObject: value forKey: key];
{
[values setObject: value forKey: key];
}
else
{
// Use a marker for missing values
[values setObject: [NSNull null] forKey: key];
}
}
else if ([[NSNull null] isEqual: value])
{
// filter out our marker value
return nil;
}
return value;