mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:00:37 +00:00
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:
parent
a9204dade5
commit
6b7156882f
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue