mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Prevent null deref in the "restore the values of nodes" algo
This commit is contained in:
parent
c90c5aad29
commit
a3b3f2f30d
|
|
@ -2294,12 +2294,12 @@ void restore_the_values_of_nodes(Vector<RecordedNodeValue> const& values)
|
|||
|
||||
// 2. If ancestor is not an Element, set it to its parent.
|
||||
if (!is<DOM::Element>(*ancestor))
|
||||
ancestor = *ancestor->parent();
|
||||
ancestor = ancestor->parent();
|
||||
|
||||
// 3. While ancestor is an Element and its specified command value for command is null, set it to its parent.
|
||||
auto const& command = recorded_node_value.command;
|
||||
while (is<DOM::Element>(*ancestor) && !specified_command_value(static_cast<DOM::Element&>(*ancestor), command).has_value())
|
||||
ancestor = *ancestor->parent();
|
||||
while (is<DOM::Element>(ancestor.ptr()) && !specified_command_value(static_cast<DOM::Element&>(*ancestor), command).has_value())
|
||||
ancestor = ancestor->parent();
|
||||
|
||||
// FIXME: 4. If value is null and ancestor is an Element, push down values on node for command, with new value null.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user