diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index d7af878c2cf..1109a98d711 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -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; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index ecb83088373..aaad03672e6 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -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 );