msxml3: removeChild should catch a NULL child node.
This commit is contained in:
parent
120e808f13
commit
a307901ac0
|
@ -452,6 +452,9 @@ static HRESULT WINAPI xmlnode_removeChild(
|
||||||
TRACE("%p->(%p, %p)\n", This, childNode, oldChild);
|
TRACE("%p->(%p, %p)\n", This, childNode, oldChild);
|
||||||
|
|
||||||
*oldChild = NULL;
|
*oldChild = NULL;
|
||||||
|
|
||||||
|
if(!childNode) return E_INVALIDARG;
|
||||||
|
|
||||||
hr = IXMLDOMNode_QueryInterface(childNode, &IID_IXMLDOMNode, (LPVOID)&child);
|
hr = IXMLDOMNode_QueryInterface(childNode, &IID_IXMLDOMNode, (LPVOID)&child);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -1054,6 +1054,9 @@ static void test_removeChild(void)
|
||||||
r = IXMLDOMNodeList_get_item( node_list, 0, &node4 );
|
r = IXMLDOMNodeList_get_item( node_list, 0, &node4 );
|
||||||
ok( r == S_OK, "ret %08lx\n", r);
|
ok( r == S_OK, "ret %08lx\n", r);
|
||||||
|
|
||||||
|
r = IXMLDOMElement_removeChild( element, NULL, &node2 );
|
||||||
|
ok( r == E_INVALIDARG, "ret %08lx\n", r );
|
||||||
|
|
||||||
r = IXMLDOMElement_removeChild( element, node4, &node2 );
|
r = IXMLDOMElement_removeChild( element, node4, &node2 );
|
||||||
ok( r == S_OK, "ret %08lx\n", r);
|
ok( r == S_OK, "ret %08lx\n", r);
|
||||||
ok( node4 == node2, "node %p node2 %p\n", node4, node2 );
|
ok( node4 == node2, "node %p node2 %p\n", node4, node2 );
|
||||||
|
|
Loading…
Reference in New Issue