Commit 13df0428 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

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

parent d2c936d4
......@@ -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");
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment