mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Check for nil when replacing object in array.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26525 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c6512d3d22
commit
b90ea547bc
2 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2008-05-14 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/GSArray.m: Fix bug allowing nil to be placed in array.
|
||||||
|
|
||||||
2008-05-01 Richard Frith-Macdonald <rfm@gnu.org>
|
2008-05-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: try to use libffi on sparc64 as libffcall does not
|
* configure.ac: try to use libffi on sparc64 as libffcall does not
|
||||||
|
|
|
@ -714,6 +714,21 @@ static Class GSInlineArrayClass;
|
||||||
{
|
{
|
||||||
[self _raiseRangeExceptionWithIndex: index from: _cmd];
|
[self _raiseRangeExceptionWithIndex: index from: _cmd];
|
||||||
}
|
}
|
||||||
|
if (!anObject)
|
||||||
|
{
|
||||||
|
NSException *exception;
|
||||||
|
NSDictionary *info;
|
||||||
|
|
||||||
|
info = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
[NSNumber numberWithUnsignedInt: index], @"Index",
|
||||||
|
_contents_array[index], @"OLdObject",
|
||||||
|
self, @"Array", nil, nil];
|
||||||
|
|
||||||
|
exception = [NSException exceptionWithName: NSInvalidArgumentException
|
||||||
|
reason: @"Tried to replace object in array with nil"
|
||||||
|
userInfo: info];
|
||||||
|
[exception raise];
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Swap objects in order so that there is always a valid object in the
|
* Swap objects in order so that there is always a valid object in the
|
||||||
* array in case a retain or release causes an exception.
|
* array in case a retain or release causes an exception.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue