Encourage better coding by warning about attempts to remove nil objects

from arrays.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5131 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-11-04 10:42:20 +00:00
parent b9fe4e75e2
commit 11d14c597d
6 changed files with 88 additions and 32 deletions

View file

@ -234,10 +234,12 @@
- (void) removeObject: (NSObject *)anObject
{
if (anObject)
if (anObject == nil)
{
GSIMapRemoveKey(&map, (GSIMapKey)anObject);
NSLog(@"attempt to remove nil object");
return;
}
GSIMapRemoveKey(&map, (GSIMapKey)anObject);
}
- (void) removeAllObjects