Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnustep/libs-base
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Jul 17, 2024
2 parents a0a62fb + 2c1a993 commit d013420
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Source/NSConcreteHashTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,11 @@ - (void) addObject: (id)anObject
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);
Expand Down
8 changes: 4 additions & 4 deletions Source/NSConcreteMapTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -1382,11 +1382,11 @@ - (void) setObject: (id)anObject forKey: (id)aKey
{
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)
Expand Down

0 comments on commit d013420

Please sign in to comment.