diff options
author | MacDue <macdue@dueutil.tech> | 2022-12-18 01:18:19 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-12-19 11:37:56 -0500 |
commit | 88e50869f1360e3d78bfbd99a39a4c313cac9e3f (patch) | |
tree | eaab98c359f5715c42c581594e502fe5887bef4a /Userland | |
parent | f11e6beca82b92ba456d8c472b1e2bc8d2b1b708 (diff) | |
download | serenity-88e50869f1360e3d78bfbd99a39a4c313cac9e3f.zip |
LibWeb: Fix crash when serializing nodes for DOM inspector
Noticed this trying to inspect GitHub, you'd get a segfault due to the
parent node being null here.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index d213cb4385..735ab0e1f2 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -1015,7 +1015,7 @@ bool Node::is_uninteresting_whitespace_node() const return false; if (!layout_node()) return true; - if (layout_node()->parent()->is_anonymous()) + if (auto parent = layout_node()->parent(); parent && parent->is_anonymous()) return true; return false; } |