Fixing bug 444128, |MacApplicationDelegate| in toolkit throws ObjC exception when creating a |NSMenuItem| with a |nil| |NSString *|. r=josh, sr=roc

This commit is contained in:
Nick Kreeger 2008-07-15 10:27:55 -07:00
parent 997038bbf3
commit 6d9641aace

View File

@ -245,9 +245,12 @@ static NSWindow* GetCocoaWindowForXULWindow(nsISupports *aXULWindow)
NSWindow *cocoaWindow = GetCocoaWindowForXULWindow(xulWindow);
if (!cocoaWindow) continue;
NSString *windowTitle = [cocoaWindow title];
if (!windowTitle) continue;
// Now, create a menu item, and add it to the menu
NSMenuItem *menuItem = [[NSMenuItem alloc]
initWithTitle:[cocoaWindow title]
initWithTitle:windowTitle
action:@selector(dockMenuItemSelected:)
keyEquivalent:@""];
[menuItem setTarget:self];