From 60ffc18bd5553a72b027426cdc21cc451fe42a7f Mon Sep 17 00:00:00 2001 From: "jkeiser%netscape.com" Date: Thu, 22 Aug 2002 02:49:36 +0000 Subject: [PATCH] Make clicking button outside of form not crash (bug 163327), r=alexsavulov@netscape.com, sr=dbaron@fas.harvard.edu --- content/html/content/src/nsHTMLButtonElement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp index c4ba5b0b3204..1d325fb84127 100644 --- a/content/html/content/src/nsHTMLButtonElement.cpp +++ b/content/html/content/src/nsHTMLButtonElement.cpp @@ -501,7 +501,8 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext* aPresContext, case NS_MOUSE_LEFT_CLICK: { - if (mType == NS_FORM_BUTTON_SUBMIT || mType == NS_FORM_BUTTON_RESET) { + if ((mType == NS_FORM_BUTTON_SUBMIT || mType == NS_FORM_BUTTON_RESET) && + mForm) { nsFormEvent event; event.eventStructType = NS_FORM_EVENT; event.message = (mType == NS_FORM_BUTTON_RESET)