WebCore:
[WebKit-https.git] / WebCore / dom / Document.cpp
index 8deee67a2d39359026a8c75f4db95ba117caf455..4f666723b4bf4a0156a32e0ffbcce94a0dc47647 100644 (file)
@@ -1886,6 +1886,10 @@ bool Document::childTypeAllowed(NodeType type)
 
 bool Document::canReplaceChild(Node* newChild, Node* oldChild)
 {
+    if (!oldChild)
+        // ContainerNode::replaceChild will raise a NOT_FOUND_ERR.
+        return true;
+
     if (oldChild->nodeType() == newChild->nodeType())
         return true;