MacOS-X compatibility fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20274 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2004-10-31 10:08:20 +00:00
parent 06a018b3db
commit 178c64a8a5
2 changed files with 11 additions and 5 deletions

View file

@ -1194,23 +1194,23 @@ static BOOL isPlistObject(id o)
* if this is the first change to a persistent-domain since the
* last -synchronize.
* </p>
* If value is nil, this is equivalent to the -removeObjectForKey: method.
*/
- (void) setObject: (id)value forKey: (NSString*)defaultName
{
NSMutableDictionary *dict;
id obj;
if (value == nil)
{
[self removeObjectForKey: defaultName];
}
if ([defaultName isKindOfClass: [NSString class]] == NO
|| [defaultName length] == 0)
{
[NSException raise: NSInvalidArgumentException
format: @"attempt to set object with bad key (%@)", defaultName];
}
if (value == nil)
{
[NSException raise: NSInvalidArgumentException
format: @"attempt to set nil object for key (%@)", defaultName];
}
if (isPlistObject(value) == NO)
{
[NSException raise: NSInvalidArgumentException