Bug 1115957 - Protect DevTools from empty browsers array. r=ochameau a=sylvestre
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 29 Dec 2014 14:04:05 -0600
changeset 242636 547ac027bc25302f44f8e12a17a4304bd3162a7d
parent 242635 a571d150a8f16e79c67eba8c8619b3bab536cb3a
child 242637 b6b89746c58b08bcacfb0d97f29134cb2de07312
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, sylvestre
bugs1115957
milestone36.0a2
Bug 1115957 - Protect DevTools from empty browsers array. r=ochameau a=sylvestre
toolkit/devtools/server/actors/webbrowser.js
--- a/toolkit/devtools/server/actors/webbrowser.js
+++ b/toolkit/devtools/server/actors/webbrowser.js
@@ -280,17 +280,18 @@ BrowserTabList.prototype._getBrowsers = 
     // browser.contentWindow as the debuggee global.
     for (let browser of this._getChildren(win)) {
       yield browser;
     }
   }
 };
 
 BrowserTabList.prototype._getChildren = function(aWindow) {
-  return aWindow.gBrowser ? aWindow.gBrowser.browsers : [];
+  let children = aWindow.gBrowser ? aWindow.gBrowser.browsers : [];
+  return children ? children : [];
 };
 
 BrowserTabList.prototype._isRemoteBrowser = function(browser) {
   return browser.getAttribute("remote") == "true";
 };
 
 BrowserTabList.prototype.getList = function() {
   let topXULWindow = Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType);