From 6d9641aaced7f599379bc706ad8ad7f65cd0e266 Mon Sep 17 00:00:00 2001 From: Nick Kreeger Date: Tue, 15 Jul 2008 10:27:55 -0700 Subject: [PATCH] Fixing bug 444128, |MacApplicationDelegate| in toolkit throws ObjC exception when creating a |NSMenuItem| with a |nil| |NSString *|. r=josh, sr=roc --- toolkit/xre/MacApplicationDelegate.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toolkit/xre/MacApplicationDelegate.mm b/toolkit/xre/MacApplicationDelegate.mm index 9c3fc7e7aa5c..8efde11e29c9 100644 --- a/toolkit/xre/MacApplicationDelegate.mm +++ b/toolkit/xre/MacApplicationDelegate.mm @@ -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];