Bug 604449 - Protect against an outer window that has already been closed. r=jst

--HG--
extra : rebase_source : 9aa28d1ab4eff66f12806893c24930fcafad1d66
This commit is contained in:
Blake Kaplan 2010-10-25 12:15:04 -07:00
parent f3be4765a0
commit bce9444a67

View File

@ -5814,7 +5814,7 @@ nsDOMConstructor::Create(const PRUnichar* aName,
nsPIDOMWindow* outerWindow = aOwner->GetOuterWindow();
nsPIDOMWindow* currentInner =
outerWindow ? outerWindow->GetCurrentInnerWindow() : aOwner;
if (!outerWindow ||
if (!currentInner ||
(aOwner != currentInner &&
!nsContentUtils::CanCallerAccess(currentInner) &&
!(currentInner = aOwner)->IsInnerWindow())) {