LibWeb: Check parent node exists before checking its type

This commit is contained in:
Tim Ledbetter 2025-07-15 06:18:31 +01:00 committed by Shannon Booth
parent 8002efe780
commit d1678e03ff
Notes: github-actions[bot] 2025-07-15 06:39:00 +00:00
2 changed files with 8 additions and 1 deletions

View file

@ -232,7 +232,7 @@ void XMLDocumentBuilder::element_end(const XML::Name& name)
};
auto* parent = m_current_node->parent_node();
if (parent->is_document_fragment()) {
if (parent && parent->is_document_fragment()) {
auto template_parent_node = m_template_node_stack.take_last();
parent = template_parent_node.ptr();
}