mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Update hadling of nil args to match OS-X
This commit is contained in:
parent
1a1e7f7fc5
commit
2c1a993612
2 changed files with 8 additions and 8 deletions
|
@ -837,11 +837,11 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
|
|||
GSIMapTable t = (GSIMapTable)self;
|
||||
GSIMapNode n;
|
||||
|
||||
if (anObject == nil)
|
||||
if (nil == anObject)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@-%@:] given nil argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
/* Tested behavior on os-x 14.5 is to do nothing if the arg is nil
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
n = GSIMapNodeForKey(t, (GSIMapKey)anObject);
|
||||
|
|
|
@ -1382,11 +1382,11 @@ const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks =
|
|||
{
|
||||
GSIMapNode node;
|
||||
|
||||
if (aKey == nil)
|
||||
if (nil == aKey || nil == anObject)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@-%@:] given nil argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
/* tested behavior on os-x 14.5 is to do nothing if either arg is nil
|
||||
*/
|
||||
return;
|
||||
}
|
||||
node = GSIMapNodeForKey(self, (GSIMapKey)aKey);
|
||||
if (node)
|
||||
|
|
Loading…
Reference in a new issue