msxml3: removeChild should catch a NULL child node.

This commit is contained in:
Huw Davies 2006-07-18 15:54:16 +01:00 committed by Alexandre Julliard
parent 120e808f13
commit a307901ac0
2 changed files with 6 additions and 0 deletions

View File

@ -452,6 +452,9 @@ static HRESULT WINAPI xmlnode_removeChild(
TRACE("%p->(%p, %p)\n", This, childNode, oldChild);
*oldChild = NULL;
if(!childNode) return E_INVALIDARG;
hr = IXMLDOMNode_QueryInterface(childNode, &IID_IXMLDOMNode, (LPVOID)&child);
if(FAILED(hr))
return hr;

View File

@ -1054,6 +1054,9 @@ static void test_removeChild(void)
r = IXMLDOMNodeList_get_item( node_list, 0, &node4 );
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 );
ok( r == S_OK, "ret %08lx\n", r);
ok( node4 == node2, "node %p node2 %p\n", node4, node2 );