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:
jonathanosx 2010-12-13 17:50:09 +00:00
parent a9204dade5
commit 6b7156882f
2 changed files with 9 additions and 1 deletions

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