From kde-commits Mon Jun 30 23:06:56 2003 From: David Faure Date: Mon, 30 Jun 2003 23:06:56 +0000 To: kde-commits Subject: KDE_3_1_BRANCH: kdelibs/khtml/xml X-MARC-Message: https://marc.info/?l=kde-commits&m=105701502502820 CVS commit by faure: Backport from HEAD: don't crash importNode when giving it a null node. (Found thanks to PMK's regression testing framework) M +8 -1 dom_docimpl.cpp 1.200.2.8 --- kdelibs/khtml/xml/dom_docimpl.cpp #1.200.2.7:1.200.2.8 @@ -354,4 +354,11 @@ NodeImpl *DocumentImpl::importNode(NodeI { NodeImpl *result = 0; + + // Not mentioned in spec: throw NOT_FOUND_ERR if evt is null + if (!importedNode) { + exceptioncode = DOMException::NOT_FOUND_ERR; + return 0; + } + if(importedNode->nodeType() == Node::ELEMENT_NODE)