Bug 1451122 - Catch errors on uninstallable add-ons. r=Felipe a=jcristau
authorMichael Kaply <mozilla@kaply.com>
Tue, 03 Apr 2018 16:15:13 -0500
changeset 463075 5eadcc787606ed668f7a1b81ec1a82cbb9089d94
parent 463074 a0d6b2482db09ead5e91ca1899fc70b14d30bf9b
child 463076 16c3c8337b63913baa0f3fe797d7975d8e23d9a9
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, jcristau
bugs1451122
milestone60.0
Bug 1451122 - Catch errors on uninstallable add-ons. r=Felipe a=jcristau
browser/components/enterprisepolicies/Policies.jsm
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -409,17 +409,22 @@ var Policies = {
           }
         });
       }
       if ("Uninstall" in param) {
         runOncePerModification("extensionsUninstall", JSON.stringify(param.Uninstall), () => {
           AddonManager.getAddonsByIDs(param.Uninstall, (addons) => {
             for (let addon of addons) {
               if (addon) {
-                addon.uninstall();
+                try {
+                  addon.uninstall();
+                } catch (e) {
+                  // This can fail for add-ons that can't be uninstalled.
+                  // Just ignore.
+                }
               }
             }
           });
         });
       }
       if ("Locked" in param) {
         for (let ID of param.Locked) {
           manager.disallowFeature(`modify-extension:${ID}`);