From d4e201e366294eb078e5a08d82d141acb6d11ddc Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sat, 29 May 1999 21:43:24 +0000 Subject: [PATCH] make sure mScriptContextOwner isn't NULL (apologies to sspitzer, made the test consistent with line #2283, hope you don't mind) git-svn-id: svn://10.0.0.236/trunk@33252 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocument.cpp | 10 ++++------ mozilla/layout/base/src/nsDocument.cpp | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 99a47c13a15..97dd15e47ed 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -2266,13 +2266,11 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext, } //Capturing stage - if (NS_EVENT_FLAG_BUBBLE != aFlags) { + if (NS_EVENT_FLAG_BUBBLE != aFlags && nsnull != mScriptContextOwner) { nsIScriptGlobalObject* mGlobal; - if (mScriptContextOwner != nsnull) { - if (NS_OK == mScriptContextOwner->GetScriptGlobalObject(&mGlobal)) { - mGlobal->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, NS_EVENT_FLAG_CAPTURE, aEventStatus); - NS_RELEASE(mGlobal); - } + if (NS_OK == mScriptContextOwner->GetScriptGlobalObject(&mGlobal)) { + mGlobal->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, NS_EVENT_FLAG_CAPTURE, aEventStatus); + NS_RELEASE(mGlobal); } } diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index 99a47c13a15..97dd15e47ed 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -2266,13 +2266,11 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext, } //Capturing stage - if (NS_EVENT_FLAG_BUBBLE != aFlags) { + if (NS_EVENT_FLAG_BUBBLE != aFlags && nsnull != mScriptContextOwner) { nsIScriptGlobalObject* mGlobal; - if (mScriptContextOwner != nsnull) { - if (NS_OK == mScriptContextOwner->GetScriptGlobalObject(&mGlobal)) { - mGlobal->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, NS_EVENT_FLAG_CAPTURE, aEventStatus); - NS_RELEASE(mGlobal); - } + if (NS_OK == mScriptContextOwner->GetScriptGlobalObject(&mGlobal)) { + mGlobal->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, NS_EVENT_FLAG_CAPTURE, aEventStatus); + NS_RELEASE(mGlobal); } }