Bug 914748 - openURI and openURIInFrame should not throw exceptions in the OPEN_NEWTAB case when they didn't create a new browser. r=felipe

--HG--
extra : rebase_source : d165be0f58bf138bed3ef59559b74b81d5ed2a57
This commit is contained in:
Dão Gottwald 2013-09-16 11:21:46 +02:00
parent cf3e214203
commit 66bcb8dd1b

View File

@ -4445,7 +4445,8 @@ nsBrowserAccess.prototype = {
break;
case Ci.nsIBrowserDOMWindow.OPEN_NEWTAB :
let browser = this._openURIInNewTab(aURI, aOpener, isExternal);
newWindow = browser.contentWindow;
if (browser)
newWindow = browser.contentWindow;
break;
default : // OPEN_CURRENTWINDOW or an illegal value
newWindow = content;
@ -4470,7 +4471,10 @@ nsBrowserAccess.prototype = {
var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
let browser = this._openURIInNewTab(aURI, aOpener, isExternal);
return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
if (browser)
return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
return null;
},
isTabContentWindow: function (aWindow) {