From e35a3f19c72904bd555906202bd0d2c86544dfd5 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Fri, 7 Apr 2023 23:22:26 +0800 Subject: Issue #252 - Follow-up: Include a null check against mDocument --- layout/base/nsPresShell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layout') diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 466a892dbe..f95b14f242 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2978,7 +2978,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) { -- cgit v1.2.3