diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 2b99cadd0970..28f217d125fc 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1201,9 +1201,11 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext, constructorSender->IsForApp(), constructorSender->IsForBrowser()); - RefPtr constructedTabParent = TabParent::GetFrom(browser); - constructedTabParent->SetOwnerElement(aFrameElement); - return constructedTabParent; + if (browser) { + RefPtr constructedTabParent = TabParent::GetFrom(browser); + constructedTabParent->SetOwnerElement(aFrameElement); + return constructedTabParent; + } } return nullptr; }