From fc8693795b892b2077beab30b91ee5d2590ad7c0 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Sun, 2 Feb 2020 17:02:38 +0000 Subject: [PATCH] Bug 1597478 - follow up: add the null check for `mPresContext`. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D61416 --HG-- extra : moz-landing-system : lando --- layout/base/nsDocumentViewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index e725c2fb3a1b..6dcd47ebad30 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -3871,6 +3871,9 @@ bool nsDocumentViewer::ShouldAttachToTopLevel() { #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || \ defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_UIKIT) + if (!mPresContext) { + return false; + } // On windows, in the parent process we also attach, but just to // chrome items