Bug 763162 - crash in nsXULMenuitemAccessibleNativeInteractiveState, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Sat, 09 Jun 2012 07:00:03 -0400
changeset 98964 6ec11aada3926362df4ac796e3bab20561b60c97
parent 98963 38dfc0d628b41c84e7b6bf09f7160ab18e8ea8ec
child 98965 f7bb11da7be6dd8c67e396d88de65ee6084615cc
push idunknown
push userunknown
push dateunknown
reviewerssurkov
bugs763162
milestone16.0a1
Bug 763162 - crash in nsXULMenuitemAccessibleNativeInteractiveState, r=surkov
accessible/src/xul/XULMenuAccessible.cpp
--- a/accessible/src/xul/XULMenuAccessible.cpp
+++ b/accessible/src/xul/XULMenuAccessible.cpp
@@ -115,17 +115,17 @@ XULMenuitemAccessible::NativeState()
 
 PRUint64
 XULMenuitemAccessible::NativeInteractiveState() const
 {
   if (NativelyUnavailable()) {
     // Note: keep in sinc with nsXULPopupManager::IsValidMenuItem() logic.
     bool skipNavigatingDisabledMenuItem = true;
     nsMenuFrame* menuFrame = do_QueryFrame(GetFrame());
-    if (!menuFrame->IsOnMenuBar()) {
+    if (!menuFrame || !menuFrame->IsOnMenuBar()) {
       skipNavigatingDisabledMenuItem = LookAndFeel::
         GetInt(LookAndFeel::eIntID_SkipNavigatingDisabledMenuItem, 0) != 0;
     }
 
     if (skipNavigatingDisabledMenuItem)
       return states::UNAVAILABLE;
 
     return states::UNAVAILABLE | states::FOCUSABLE | states::SELECTABLE;