summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-03-10 11:44:28 +0100
committerMoonchild <moonchild@palemoon.org>2023-03-10 11:44:28 +0100
commit476dec2351c75e3bf7355fbe111c604f32e5b558 (patch)
tree40c9b4342796e767681a4407e65f1019397ada6a /layout
parent1affd523ec66ce87376d892cd499724bba8e10ea (diff)
downloaduxp-476dec2351c75e3bf7355fbe111c604f32e5b558.tar.gz
Issue #2135 - Follow-up: Check for aElement not being null
This was introduced to Make <link rel="stylesheet"> work in shadow trees. eElement can, however, be `null` here and if so, it would crash.
Diffstat (limited to 'layout')
-rw-r--r--layout/style/Loader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp
index 1be703c027..ce9a601a90 100644
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -2083,7 +2083,7 @@ Loader::LoadStyleLink(nsIContent* aElement,
PrepareSheet(sheet, aTitle, aMedia, nullptr, nullptr, *aIsAlternate, *aIsExplicitlyEnabled);
- if (aElement->HasFlag(NODE_IS_IN_SHADOW_TREE)) {
+ if (aElement && aElement->HasFlag(NODE_IS_IN_SHADOW_TREE)) {
aElement->GetContainingShadow()->InsertSheet(sheet, aElement);
} else {
rv = InsertSheetInDoc(sheet, aElement, mDocument);