Bug 1383848 - Null check library button since it's not there by default. r=jaws
authorMichael Kaply <mozilla@kaply.com>
Mon, 24 Jul 2017 13:58:43 -0500
changeset 614722 b0521321d61a0db36079145b80cf01fdb6b09cb2
parent 614721 a7da25c837d870a5b4e10d1a5911d3fafdf75592
child 614723 ea313d4b3093a9ad9d014e8860fc00dd4ed59e40
push id70091
push userhikezoe@mozilla.com
push dateMon, 24 Jul 2017 22:05:18 +0000
reviewersjaws
bugs1383848
milestone56.0a1
Bug 1383848 - Null check library button since it's not there by default. r=jaws MozReview-Commit-ID: 4IRASZc5icm
browser/extensions/pocket/content/Pocket.jsm
--- a/browser/extensions/pocket/content/Pocket.jsm
+++ b/browser/extensions/pocket/content/Pocket.jsm
@@ -1,9 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
+  /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = ["Pocket"];
 
@@ -29,17 +29,19 @@ var Pocket = {
   },
 
   onPanelViewShowing(event) {
     let document = event.target.ownerDocument;
     let window = document.defaultView;
     let iframe = window.pktUI.getPanelFrame();
 
     let libraryButton = document.getElementById("library-button");
-    BrowserUtils.setToolbarButtonHeightProperty(libraryButton);
+    if (libraryButton) {
+      BrowserUtils.setToolbarButtonHeightProperty(libraryButton);
+    }
 
     let urlToSave = Pocket._urlToSave;
     let titleToSave = Pocket._titleToSave;
     Pocket._urlToSave = null;
     Pocket._titleToSave = null;
     // ViewShowing fires immediately before it creates the contents,
     // in lieu of an AfterViewShowing event, just spin the event loop.
     window.setTimeout(function() {