diff --git a/ChangeLog b/ChangeLog index 8d92372c8..f9692017d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * Source/GSFormat.m: optimise a bit and fix bug where utf8 (and other multibyte encodings) strings could be truncated at the wrong precision. + * Source/NSIndexPath.m: ([indexAtPosition:]) return NSNotFound if + given a bad position. * Source/NSObject.m: implement CRASH_ON_ZOMBIE * Documentation/Base.gsdoc: document it. diff --git a/Source/NSIndexPath.m b/Source/NSIndexPath.m index d8916a49e..d13009f2f 100644 --- a/Source/NSIndexPath.m +++ b/Source/NSIndexPath.m @@ -196,7 +196,9 @@ static NSIndexPath *dummy = nil; - (unsigned) indexAtPosition: (unsigned)position { if (position >= _length) - [NSException raise: NSRangeException format: @"Invalid location."]; + { + return NSNotFound; + } return _indexes[position]; }