Bug 1383848 - Null check library button since it's not there by default. r?jaws draft
authorMichael Kaply <mozilla@kaply.com>
Mon, 24 Jul 2017 13:58:43 -0500
changeset 614554 7a64f1658ec931dc1e37832472619ad9301e5e6e
parent 614544 462d7561089c98e33382384896434861ad7bc491
child 638896 be087c385ba85a2432473d8c98f3e50d8e3dce6e
push id70045
push usermozilla@kaply.com
push dateMon, 24 Jul 2017 18:59:03 +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() {