diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 12:40:03 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 12:40:03 +0200 |
commit | a8b1780786d308e5eb520a9182879f9f6558ffaf (patch) | |
tree | af443d9649810db152c81ddeba4fe35e46147b43 /application/palemoon | |
parent | e0b1636542f2a15d1f83042072f383a62f4e16d9 (diff) | |
download | UXP-a8b1780786d308e5eb520a9182879f9f6558ffaf.tar UXP-a8b1780786d308e5eb520a9182879f9f6558ffaf.tar.gz UXP-a8b1780786d308e5eb520a9182879f9f6558ffaf.tar.lz UXP-a8b1780786d308e5eb520a9182879f9f6558ffaf.tar.xz UXP-a8b1780786d308e5eb520a9182879f9f6558ffaf.zip |
Bug 1280775 - null check in removePermission to prevent crash: permission manager change
Diffstat (limited to 'application/palemoon')
-rw-r--r-- | application/palemoon/components/preferences/advanced.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/application/palemoon/components/preferences/advanced.js b/application/palemoon/components/preferences/advanced.js index 451af6f78..0803496fe 100644 --- a/application/palemoon/components/preferences/advanced.js +++ b/application/palemoon/components/preferences/advanced.js @@ -475,23 +475,23 @@ var gAdvancedPane = { var pm = Components.classes["@mozilla.org/permissionmanager;1"] .getService(Components.interfaces.nsIPermissionManager); var perm = pm.getPermissionObject(principal, "offline-app"); - - // clear offline cache entries - var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]. - getService(Components.interfaces.nsIApplicationCacheService); - var ios = Components.classes["@mozilla.org/network/io-service;1"]. - getService(Components.interfaces.nsIIOService); - var groups = cacheService.getGroups(); - for (var i = 0; i < groups.length; i++) { - var uri = ios.newURI(groups[i], null, null); - if (perm.matchesURI(uri, true)) { + if (perm) { + // clear offline cache entries + try { + var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]. + getService(Components.interfaces.nsIApplicationCacheService); + var groups = cacheService.getGroups(); + for (var i = 0; i < groups.length; i++) { + var uri = Services.io.newURI(groups[i], null, null); + if (perm.matchesURI(uri, true)) { var cache = cacheService.getActiveCache(groups[i]); cache.discard(); + } } - } - - pm.removePermission(perm); + } catch (e) {} + pm.removePermission(perm); + } list.removeChild(item); gAdvancedPane.offlineAppSelected(); this.updateActualAppCacheSize(); |