Bug 1810903, return early from LoadErrorPage if the docshell is going away, r=peterv

We'd return early anyhow later in nsDocShell::InternalLoad.
The patch is based on code inspection. If one is closing the window while printing, we could get to this state, among other cases.

Differential Revision: https://phabricator.services.mozilla.com/D168368
This commit is contained in:
Olli Pettay
2023-01-31 13:47:50 +00:00
parent 27a1221161
commit 3d966f9982

View File

@@ -3956,7 +3956,9 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
const char16_t* aDescription,
const char* aCSSClass,
nsIChannel* aFailedChannel) {
MOZ_ASSERT(!mIsBeingDestroyed);
if (mIsBeingDestroyed) {
return NS_ERROR_NOT_AVAILABLE;
}
#if defined(DEBUG)
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {