Bug 1336291 - Lots of 'TypeError: this._browsers is null' browser_remotenewtab_pageloads.js. r=Felipe
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 06 Feb 2017 18:54:54 +0100
changeset 341108 ec06d5263eb38d2b9b8a02b759c2e4d4bfdf54b3
parent 341107 0505ef568bc7bb884b991f951531866899bfd0a2
child 341109 7a30bb12372f7c6c8811db1f7d9de343cde05556
push id31326
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 23:57:02 +0000
treeherdermozilla-central@c80c2c7bc043 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1336291
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1336291 - Lots of 'TypeError: this._browsers is null' browser_remotenewtab_pageloads.js. r=Felipe MozReview-Commit-ID: HrQm0Rh9vCN
browser/components/newtab/NewTabWebChannel.jsm
--- a/browser/components/newtab/NewTabWebChannel.jsm
+++ b/browser/components/newtab/NewTabWebChannel.jsm
@@ -140,16 +140,20 @@ NewTabWebChannelImpl.prototype = {
 
     return false;
   },
 
   /*
    * Obtains all known browser refs
    */
   _getBrowserRefs() {
+    // Some code may try to emit messages after teardown.
+    if (!this._browsers) {
+      return [];
+    }
     let refs = [];
     for (let bRef of this._browsers) {
       /*
        * even though we hold a weak ref to browser, it seems that browser
        * objects aren't gc'd immediately after a tab closes. They stick around
        * in memory, but thankfully they don't have a documentURI in that case
        */
       let browser = bRef.get();