From b51bf27f132adb50de81faaf656885729eaf2389 Mon Sep 17 00:00:00 2001 From: Andreas Farre Date: Tue, 23 Jan 2024 08:04:51 +0000 Subject: [PATCH] Bug 1875040 - Use GetExtantDocument instead of GetDocument. r=smaug Avoids accidentally creating a document when checking if a document's presentation can be saved. Differential Revision: https://phabricator.services.mozilla.com/D198781 --- docshell/base/nsDocShell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 0b8212fbf3f8..c77e96438d25 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -9436,7 +9436,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, // separate check for SHIP so that we know if there are ongoing requests // before calling Stop() below. if (mozilla::SessionHistoryInParent()) { - Document* document = GetDocument(); + Document* document = GetExtantDocument(); uint32_t flags = 0; if (document && !document->CanSavePresentation(nullptr, flags, true)) { // This forces some flags into the WindowGlobalParent's mBFCacheStatus,