浏览代码

LibWeb: Assert that cloned node is not null before returning

This makes potential issues easier to track down.
Tim Ledbetter 1 年之前
父节点
当前提交
f8b1e96e2b
共有 1 个文件被更改,包括 1 次插入0 次删除
  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 };
 }