mshtml: Properly handle NULL VT_DISPATCH refChild in IHTMLDOMNode::insertBefore.

This commit is contained in:
Jacek Caban 2012-07-26 17:52:42 +02:00 committed by Alexandre Julliard
parent d2c936d4af
commit 13df042891
2 changed files with 9 additions and 0 deletions

View File

@ -513,6 +513,8 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
case VT_NULL:
break;
case VT_DISPATCH: {
if(!V_DISPATCH(&refChild))
break;
ref_node = get_node_obj(This->doc, (IUnknown*)V_DISPATCH(&refChild));
if(!ref_node) {
ERR("unvalid node\n");

View File

@ -5920,6 +5920,13 @@ static void test_create_elems(IHTMLDocument2 *doc)
test_elem_innertext(body, "insert test");
test_elem_innerhtml((IUnknown*)body, "insert test");
node = test_create_text(doc, " Test");
V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = NULL;
test_node_insertbefore((IUnknown*)body, node, &var);
test_elem_innertext(body, "insert test Test");
IHTMLDOMNode_Release(node);
hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
if(hres == S_OK)
{