Commit b024cd6d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't crash if nsWebBrowser could not be created.

parent 9c352a11
......@@ -1602,14 +1602,17 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
ret->editor = NULL;
ret->reset_focus = NULL;
if(parent)
nsIWebBrowserChrome_AddRef(NSWBCHROME(parent));
ret->parent = parent;
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
NULL, &IID_nsIWebBrowser, (void**)&ret->webbrowser);
if(NS_FAILED(nsres))
if(NS_FAILED(nsres)) {
ERR("Creating WebBrowser failed: %08x\n", nsres);
heap_free(ret);
return NULL;
}
if(parent)
nsIWebBrowserChrome_AddRef(NSWBCHROME(parent));
ret->parent = parent;
nsres = nsIWebBrowser_SetContainerWindow(ret->webbrowser, NSWBCHROME(ret));
if(NS_FAILED(nsres))
......
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