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
This commit is contained in:
beard%netscape.com
1999-05-29 21:43:24 +00:00
parent 8d44318d91
commit d4e201e366
2 changed files with 8 additions and 12 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}