From 5069ad71b4ce3a0bf8b084842672573837e1a88a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 19 Feb 2013 17:05:11 +0100 Subject: [PATCH] mshtml: Don't crash if fire_event_obj is called on detached document. --- dlls/mshtml/htmlevent.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index ea0201fb803..97f9ea9bd17 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1057,9 +1057,14 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e TRACE("(%p) %s\n", doc, debugstr_w(event_info[eid].name)); + window = doc->window; + if(!window) { + WARN("NULL window\n"); + return; + } + htmldoc_addref(&doc->basedoc); - window = doc->window; prev_event = window->event; window->event = event_obj ? &event_obj->IHTMLEventObj_iface : NULL;