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

This commit is contained in:
Jacek Caban 2008-04-07 13:05:56 +02:00 committed by Alexandre Julliard
parent 9c352a11cc
commit b024cd6de2
1 changed files with 8 additions and 5 deletions

View File

@ -1602,15 +1602,18 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
ret->editor = NULL;
ret->reset_focus = NULL;
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
NULL, &IID_nsIWebBrowser, (void**)&ret->webbrowser);
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 = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
NULL, &IID_nsIWebBrowser, (void**)&ret->webbrowser);
if(NS_FAILED(nsres))
ERR("Creating WebBrowser failed: %08x\n", nsres);
nsres = nsIWebBrowser_SetContainerWindow(ret->webbrowser, NSWBCHROME(ret));
if(NS_FAILED(nsres))
ERR("SetContainerWindow failed: %08x\n", nsres);