summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-03-05 07:40:25 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-03-05 07:41:07 +0800
commitce47a81c5796efa1b85d083c841714a0102d3e3d (patch)
treeb50c47cdd1d8ca941367522168032d40f98e7a40 /dom
parent50124e9ea6c421194b809f0d241a843ad2dcc540 (diff)
downloaduxp-ce47a81c5796efa1b85d083c841714a0102d3e3d.tar.gz
Issue #2135 - Follow-up: Fix potential crash if shadow root is null
Diffstat (limited to 'dom')
-rw-r--r--dom/base/DocumentOrShadowRoot.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/dom/base/DocumentOrShadowRoot.cpp b/dom/base/DocumentOrShadowRoot.cpp
index 876d265cc1..f420ff6a28 100644
--- a/dom/base/DocumentOrShadowRoot.cpp
+++ b/dom/base/DocumentOrShadowRoot.cpp
@@ -277,7 +277,9 @@ DocumentOrShadowRoot::ElementsFromPointHelper(float aX, float aY,
node = node->GetParent();
if (node) {
ShadowRoot* shadow = ShadowRoot::FromNode(node);
- node = shadow->Host();
+ if (shadow) {
+ node = shadow->Host();
+ }
}
}