diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 5bb475ffb..df665811f 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -415,7 +415,14 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations"; */ - (int) indexOfItem: (id )anObject { - return [menu_items indexOfObjectIdenticalTo: anObject]; + int index; + + index = [menu_items indexOfObjectIdenticalTo: anObject]; + + if (index == NSNotFound) + return -1; + else + return index; } - (int) indexOfItemWithTitle: (NSString*)aTitle