mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1786519 - Null check BrowserParent's element and its owner doc. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D155729
This commit is contained in:
parent
d50c882977
commit
ebe08f86d0
@ -283,10 +283,15 @@ RefPtr<SessionAccessibility> SessionAccessibility::GetInstanceFor(
|
||||
bp = static_cast<dom::BrowserParent*>(
|
||||
aAccessible->AsRemote()->Document()->Manager());
|
||||
}
|
||||
nsPresContext* presContext =
|
||||
bp->GetOwnerElement()->OwnerDoc()->GetPresContext();
|
||||
if (presContext) {
|
||||
return GetInstanceFor(presContext->PresShell());
|
||||
if (auto element = bp->GetOwnerElement()) {
|
||||
if (auto doc = element->OwnerDoc()) {
|
||||
if (nsPresContext* presContext = doc->GetPresContext()) {
|
||||
return GetInstanceFor(presContext->PresShell());
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE(
|
||||
"Browser parent's element does not have owner doc.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user