Bug 1152989 - Show the base account manager panels even when an account manager extension can't be loaded. r=rkent, r=mkmelin, a=rkent
authoraceman <acelists@atlas.sk>
Thu, 23 Apr 2015 13:58:01 -0700
changeset 25985 7721a5c36df997de05abc76aace22517d05931a9
parent 25984 9a608494ae0ab5403a598a67d2e6c5adebbbcd68
child 25986 3d9e603fc3bcdaadcd24b776d316f480571159ef
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent, mkmelin, rkent
bugs1152989
Bug 1152989 - Show the base account manager panels even when an account manager extension can't be loaded. r=rkent, r=mkmelin, a=rkent
mailnews/base/prefs/content/AccountManager.js
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -1558,26 +1558,34 @@ var gAccountTree = {
           panelsToKeep.push(panels[3]);
 
         // extensions
         let catMan = Components.classes["@mozilla.org/categorymanager;1"]
                                .getService(Ci.nsICategoryManager);
         const CATEGORY = "mailnews-accountmanager-extensions";
         let catEnum = catMan.enumerateCategory(CATEGORY);
         while (catEnum.hasMoreElements()) {
-          var string = Components.interfaces.nsISupportsCString;
-          var entryName = catEnum.getNext().QueryInterface(string).data;
-          var svc = Components.classes[catMan.getCategoryEntry(CATEGORY, entryName)]
-                              .getService(Ci.nsIMsgAccountManagerExtension);
-          if (svc.showPanel(server)) {
-            let bundleName = "chrome://" + svc.chromePackageName +
-                             "/locale/am-" + svc.name + ".properties";
-            let bundle = Services.strings.createBundle(bundleName);
-            let title = bundle.GetStringFromName("prefPanel-" + svc.name);
-            panelsToKeep.push({string: title, src: "am-" + svc.name + ".xul"});
+          let entryName = null;
+          try {
+            entryName = catEnum.getNext().QueryInterface(Ci.nsISupportsCString).data;
+            let svc = Components.classes[catMan.getCategoryEntry(CATEGORY, entryName)]
+                                .getService(Ci.nsIMsgAccountManagerExtension);
+            if (svc.showPanel(server)) {
+              let bundleName = "chrome://" + svc.chromePackageName +
+                               "/locale/am-" + svc.name + ".properties";
+              let bundle = Services.strings.createBundle(bundleName);
+              let title = bundle.GetStringFromName("prefPanel-" + svc.name);
+              panelsToKeep.push({string: title, src: "am-" + svc.name + ".xul"});
+            }
+          } catch(e) {
+            // Fetching of this extension panel failed so do not show it,
+            // just log error.
+            let extName = entryName || "(unknown)";
+            Components.utils.reportError("Error accessing panel from extension '" +
+                                         extName + "': " + e);
           }
         }
         amChrome = server.accountManagerChrome;
       } catch(e) {
         // Show only a placeholder in the account list saying this account
         // is broken, with no child panels.
         let accountID = (accountName || accountKey);
         Components.utils.reportError("Error accessing account " + accountID + ": " + e);