diff options
Diffstat (limited to 'Source/SPChooseMenuItemDialog.m')
-rw-r--r-- | Source/SPChooseMenuItemDialog.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPChooseMenuItemDialog.m b/Source/SPChooseMenuItemDialog.m index 4bfdcbcb..770c1891 100644 --- a/Source/SPChooseMenuItemDialog.m +++ b/Source/SPChooseMenuItemDialog.m @@ -106,7 +106,7 @@ for (id item in theList) { - NSMenuItem *aMenuItem; + NSMenuItem *aMenuItem = nil; if ([item isKindOfClass:[NSString class]]) { aMenuItem = [[NSMenuItem alloc] initWithTitle:item action:@selector(menuItemHandler:) keyEquivalent:@""]; @@ -124,10 +124,12 @@ [aMenuItem setToolTip:[item objectForKey:@"tooltip"]]; } } - - [aMenuItem setTag:cnt++]; - [theMenu addItem:aMenuItem]; - [aMenuItem release]; + + if (aMenuItem) { + [aMenuItem setTag:cnt++]; + [theMenu addItem:aMenuItem]; + [aMenuItem release]; + } } [dialog setContextMenu:theMenu]; |