Bug 1097597 - Check if there is a Loop toolbarbutton node in updateToolbarState. r=Standard8
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 13 Nov 2014 18:59:37 +0100
changeset 215623 af2a649a6d6bbdc1ff2f4b8ed93165c75912dcef
parent 215622 4a505fb25edb636603459f0530425e84828510db
child 215624 8b35d3ba140d75c881286468d733110402f0a454
push id51796
push userryanvm@gmail.com
push dateThu, 13 Nov 2014 20:47:14 +0000
treeherdermozilla-inbound@a05b5362429f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1097597
milestone36.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 1097597 - Check if there is a Loop toolbarbutton node in updateToolbarState. r=Standard8
browser/base/content/browser-loop.js
--- a/browser/base/content/browser-loop.js
+++ b/browser/base/content/browser-loop.js
@@ -69,16 +69,19 @@ XPCOMUtils.defineLazyModuleGetter(this, 
      * @param {string} [aReason] Some states are only shown if
      *                           a related reason is provided.
      *
      *                 aReason="login": Used after a login is completed
      *                   successfully. This is used so the state can be
      *                   temporarily shown until the next state change.
      */
     updateToolbarState: function(aReason = null) {
+      if (!this.toolbarButton.node) {
+        return;
+      }
       let state = "";
       if (MozLoopService.errors.size) {
         state = "error";
       } else if (aReason == "login" && MozLoopService.userProfile) {
         state = "active";
       } else if (MozLoopService.doNotDisturb) {
         state = "disabled";
       }