Bug 1258792 - ensure window before trying to use it in update check; r=marco, a=ritu

This commit is contained in:
Myk Melez 2016-03-24 14:24:47 -07:00
parent f0b3db2d72
commit fba9e3febf

View File

@ -102,15 +102,14 @@ this.WebappRT = {
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");
if (!window.navigator.mozApps) {
return;
}
window.navigator.mozApps.mgmt.getAll().onsuccess = function() {
let thisApp = null;
for (let app of this.result) {