Bug 1252635 - confirm mozApps is defined before checking for updates; r=marco
authorMyk Melez <myk@mykzilla.org>
Tue, 01 Mar 2016 14:30:20 -0800
changeset 322662 baabb61180e8fe2d55d76ef20fa8ad8c7f4667aa
parent 322661 c1b18e68fdb5794f85fc21a9e5da47ec67760dbb
child 322663 91eedd43f7cf97300e8a1fe6aac73213bf49bcff
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco
bugs1252635
milestone47.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 1252635 - confirm mozApps is defined before checking for updates; r=marco
webapprt/WebappRT.jsm
--- a/webapprt/WebappRT.jsm
+++ b/webapprt/WebappRT.jsm
@@ -97,16 +97,20 @@ this.WebappRT = {
   startUpdateService: function() {
     let manifestURL = this.config.app.manifestURL;
     // We used to install apps without storing their manifest URL.
     // Now we can't update them.
     if (!manifestURL) {
       return;
     }
 
+    if (!window.navigator.mozApps) {
+      return;
+    }
+
     // Check for updates once a day.
     let timerManager = Cc["@mozilla.org/updates/timer-manager;1"].
                        getService(Ci.nsIUpdateTimerManager);
     timerManager.registerTimer("updateTimer", () => {
       let window = Services.wm.getMostRecentWindow("webapprt:webapp");
       window.navigator.mozApps.mgmt.getAll().onsuccess = function() {
         let thisApp = null;
         for (let app of this.result) {