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 419367 b0521321d61a0db36079145b80cf01fdb6b09cb2
parent 419366 a7da25c837d870a5b4e10d1a5911d3fafdf75592
child 419368 ea313d4b3093a9ad9d014e8860fc00dd4ed59e40
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1383848
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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() {