Prevent trying to retrieve a menuCell that is out of range.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31729 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gillaspie 2010-12-13 17:50:09 +00:00
parent 51823d2d82
commit 77495ccde1
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2010-12-13 Jonathan Gillaspie <jonathan.gillaspie@testplant.com>
* Source/NSMenuView.m:
Prevent trying to retrieve a menuCell that is out of range.
2010-12-09 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMatrix.m (-setState:atRow:column:): Fix bug where the

View file

@ -407,7 +407,10 @@ static NSMapTable *viewInfo = 0;
- (NSMenuItemCell*) menuItemCellForItemAtIndex: (int)index
{
return [_itemCells objectAtIndex: index];
if (index < [_itemCells count])
return [_itemCells objectAtIndex: index];
else
return nil;
}
- (NSMenuView*) attachedMenuView