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