Bug 777680 - followup, only update the broadcaster when it is defined. r=me
authorJared Wein <jwein@mozilla.com>
Sat, 13 Jun 2015 13:48:34 -0400
changeset 266809 3a69292cf6b49790a5479571961ac2a16d2ffc8f
parent 266808 538f0581a56bf14ce1257333606e96f55db51e0f
child 266810 4c1105d5b6a918ffeeb5d5575bd622c39c444860
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs777680
milestone41.0a1
Bug 777680 - followup, only update the broadcaster when it is defined. r=me
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1550,17 +1550,19 @@ let BookmarkingUI = {
 
   /**
    * forceReset is passed when we're destroyed and the label should go back
    * to the default (Bookmark This Page) for OS X.
    */
   _updateBookmarkPageMenuItem: function BUI__updateBookmarkPageMenuItem(forceReset) {
     let isStarred = !forceReset && this._itemIds.length > 0;
     let label = isStarred ? "editlabel" : "bookmarklabel";
-    this.broadcaster.setAttribute("label", this.broadcaster.getAttribute(label));
+    if (this.broadcaster) {
+      this.broadcaster.setAttribute("label", this.broadcaster.getAttribute(label));
+    }
   },
 
   onMainMenuPopupShowing: function BUI_onMainMenuPopupShowing(event) {
     this._updateBookmarkPageMenuItem();
     PlacesCommandHook.updateBookmarkAllTabsCommand();
   },
 
   updatePocketItemVisibility: function BUI_updatePocketItemVisibility(prefix) {