The interface is later checked for NULL, this avoids crashes in case of failure here.
-- v2: mshtml: Check get_document_node() result in get_node().
From: Paul Gofman pgofman@codeweavers.com
Suggested by Gabriel Ivăncescu. --- dlls/mshtml/htmlnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index ceb50a17d02..36e89818bb3 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1410,7 +1410,7 @@ HRESULT get_node(nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
hres = get_document_node(dom_document, &document); nsIDOMDocument_Release(dom_document); - if(!document) + if(FAILED(hres)) return E_FAIL;
hres = create_node(document, nsnode, ret);
It seems that there is not a complete solution. Depending on the reason of the failure, it's either semi-expected (in which case we should downgrade ERR to WARN) or the root of the problem is somewhere else. Anyway, the change itself is fine.
This merge request was approved by Jacek Caban.