Bug 1591467 - Add a null check when accessing the actor of the browser host in nsFrameLoader::TryRemoteBrowserInternal(). r=smaug

In some cases, the actor of the browser host might be null. So, we need
to check before accessing it in order to avoid crashes.

Differential Revision: https://phabricator.services.mozilla.com/D50715

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Huang 2019-10-29 01:21:43 +00:00
Родитель 571019ecae
Коммит f97686beae
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2528,7 +2528,10 @@ bool nsFrameLoader::TryRemoteBrowserInternal() {
RefPtr<BrowserParent> sameTabGroupAs;
if (auto* host = BrowserHost::GetFrom(parentDocShell->GetOpener())) {
openerContentParent = host->GetContentParent();
openerContentPrincipal = host->GetActor()->GetContentPrincipal();
BrowserParent* openerBrowserParent = host->GetActor();
if (openerBrowserParent) {
openerContentPrincipal = openerBrowserParent->GetContentPrincipal();
}
}
// <iframe mozbrowser> gets to skip these checks.