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 231819 af2a649a6d6bbdc1ff2f4b8ed93165c75912dcef
parent 231818 4a505fb25edb636603459f0530425e84828510db
child 231820 8b35d3ba140d75c881286468d733110402f0a454
push id7326
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:58:42 +0000
treeherdermozilla-aurora@d3a3b2a0f2f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1097597
milestone36.0a1
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";
       }