diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index 326e3098b012..2fe3d5d64bd2 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -585,9 +585,11 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag) if (menuPopup) { // inherit whether or not we're a context menu from the parent - PRBool parentIsContextMenu = PR_FALSE; - mMenuParent->GetIsContextMenu(parentIsContextMenu); - menuPopup->SetIsContextMenu(parentIsContextMenu); + if ( mMenuParent ) { + PRBool parentIsContextMenu = PR_FALSE; + mMenuParent->GetIsContextMenu(parentIsContextMenu); + menuPopup->SetIsContextMenu(parentIsContextMenu); + } // Install a keyboard navigation listener if we're the root of the menu chain. PRBool onMenuBar = PR_TRUE;