Commit 1eced605 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Check if event_table entry is allocated before using it in remove_event_handler.

parent c00121a6
......@@ -1077,7 +1077,7 @@ static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *eve
static HRESULT remove_event_handler(event_target_t **event_target, eventid_t eid)
{
if(*event_target && (*event_target)->event_table[eid]->handler_prop) {
if(*event_target && (*event_target)->event_table[eid] && (*event_target)->event_table[eid]->handler_prop) {
IDispatch_Release((*event_target)->event_table[eid]->handler_prop);
(*event_target)->event_table[eid]->handler_prop = NULL;
}
......
......@@ -1172,6 +1172,10 @@ static void test_onclick(IHTMLDocument2 *doc)
hres = IHTMLElement_put_onclick(div, v);
ok(hres == S_OK, "put_onclick failed: %08x\n", hres);
V_VT(&v) = VT_NULL;
hres = IHTMLElement_put_ondblclick(div, v);
ok(hres == S_OK, "put_ondblclick failed: %08x\n", hres);
V_VT(&v) = VT_EMPTY;
hres = IHTMLElement_get_onclick(div, &v);
ok(hres == S_OK, "get_onclick failed: %08x\n", hres);
......
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