From 7c759b2c2153a9eb9cd28f7a366b4393a4dae787 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Fri, 7 Apr 2023 23:22:26 +0800 Subject: [PATCH] Issue #252 - Follow-up: Include a null check against mDocument --- layout/base/nsPresShell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 74a0cc210f..14c8e9e906 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2986,7 +2986,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll, } // Search for an anchor element with a matching "name" attribute - if (!content && htmlDoc) { + if (!content && htmlDoc && mDocument) { // Find a matching list of named nodes nsCOMPtr list = mDocument->GetElementsByName(aAnchorName); if (list) {