From 5135144d3a04a332299092fa83192022a83ab71c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 24 Dec 2014 14:13:23 +0100 Subject: [PATCH] mshtml: Correctly handle NULL active element in IHTMLDocument2::get_activeElement. --- dlls/mshtml/htmldoc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e9b9dc9ad0d..ea56f5cee96 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -282,6 +282,11 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM return E_FAIL; } + if(!nselem) { + *p = NULL; + return S_OK; + } + hres = get_elem(This->doc_node, nselem, &elem); nsIDOMElement_Release(nselem); if(FAILED(hres))