Преглед изворни кода

LibWeb: Assert that cloned node is not null before returning

This makes potential issues easier to track down.
Tim Ledbetter пре 11 месеци
родитељ
комит
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.
     // 7. Return copy.
+    VERIFY(copy);
     return JS::NonnullGCPtr { *copy };
     return JS::NonnullGCPtr { *copy };
 }
 }