1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

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.
This commit is contained in:
MacDue 2022-12-18 01:18:19 +00:00 committed by Tim Flynn
parent f11e6beca8
commit 88e50869f1

View file

@ -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;
}