Issue #252 - Follow-up: Include a null check against mDocument

This commit is contained in:
FranklinDM 2023-04-07 23:22:26 +08:00 committed by roytam1
commit 7c759b2c21

View file

@ -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<nsIDOMNodeList> list = mDocument->GetElementsByName(aAnchorName);
if (list) {