mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 1369246 - Check if window pointer is null before attempting to call a method. r=baku
This commit is contained in:
parent
c04074e14f
commit
ece0618ecc
@ -4449,12 +4449,13 @@ nsContentUtils::GetSubdocumentWithOuterWindowId(nsIDocument *aDocument,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId)->AsOuter();
|
||||
RefPtr<nsGlobalWindow> window = nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId);
|
||||
if (!window) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> foundDoc = window->GetDoc();
|
||||
nsCOMPtr<nsPIDOMWindowOuter> outerWindow = window->AsOuter();
|
||||
nsCOMPtr<nsIDocument> foundDoc = outerWindow->GetDoc();
|
||||
if (nsContentUtils::ContentIsCrossDocDescendantOf(foundDoc, aDocument)) {
|
||||
// Note that ContentIsCrossDocDescendantOf will return true if
|
||||
// foundDoc == aDocument.
|
||||
|
Loading…
Reference in New Issue
Block a user