Bug 1097597 - Check if there is a Loop toolbarbutton node in updateToolbarState. r=Standard8
--- 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";
}