From ff741eed548cec49ec1958caf0dd55eb7d98d82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Mon, 16 Sep 2013 11:21:46 +0200 Subject: [PATCH] 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 --- browser/base/content/browser.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 7b1932e6522..d63fa124b49 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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) {