Browse Source

LibWeb: Assert that cloned node is not null before returning

This makes potential issues easier to track down.
Tim Ledbetter 11 months ago
parent
commit
f8b1e96e2b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Userland/Libraries/LibWeb/DOM/Node.cpp

+ 1 - 0
Userland/Libraries/LibWeb/DOM/Node.cpp

@@ -1040,6 +1040,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> Node::clone_node(Document* document,
     }
 
     // 7. Return copy.
+    VERIFY(copy);
     return JS::NonnullGCPtr { *copy };
 }