Bug 373483, Crash [@ nsHTMLButtonElement::PostHandleEvent] when right-clicking on the button in this testcase, r+sr=jst
authorOlli.Pettay@helsinki.fi
Mon, 02 Apr 2007 09:13:45 -0700
changeset 264 4cd31f07a14048557e4ae6a73756fd4d13174e82
parent 263 c3e0a6bb84ddac5a90a640b3811f2535074dd7d4
child 265 cf9e66542422dbc9a99c37a5c3196e1a353f6bd8
push idunknown
push userunknown
push dateunknown
bugs373483
milestone1.9a4pre
Bug 373483, Crash [@ nsHTMLButtonElement::PostHandleEvent] when right-clicking on the button in this testcase, r+sr=jst
content/html/content/src/nsHTMLButtonElement.cpp
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -429,17 +429,19 @@ nsHTMLButtonElement::PostHandleEvent(nsE
                 SetContentState(this, NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS);
               aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
             } else if (NS_STATIC_CAST(nsMouseEvent*, aVisitor.mEvent)->button ==
                          nsMouseEvent::eMiddleButton ||
                        NS_STATIC_CAST(nsMouseEvent*, aVisitor.mEvent)->button ==
                          nsMouseEvent::eRightButton) {
               // cancel all of these events for buttons
               //XXXsmaug What to do with these events? Why these should be cancelled?
-              aVisitor.mDOMEvent->StopPropagation();
+              if (aVisitor.mDOMEvent) {
+                aVisitor.mDOMEvent->StopPropagation();
+              }
             }
           }
         }
         break;
 
       // cancel all of these events for buttons
       //XXXsmaug What to do with these events? Why these should be cancelled?
       case NS_MOUSE_BUTTON_UP: