diff --git a/mail/components/about-support/content/accounts.js b/mail/components/about-support/content/accounts.js index 534cd0556d..95fa5ccad9 100644 --- a/mail/components/about-support/content/accounts.js +++ b/mail/components/about-support/content/accounts.js @@ -96,20 +96,32 @@ var AboutSupport = { const accountDetails = []; for (const account of MailServices.accounts.accounts) { - const server = account.incomingServer; - accountDetails.push({ - key: account.key, - name: server.prettyName, - hostDetails: - "(" + - server.type + - ") " + - server.hostName + - (server.port != -1 ? ":" + server.port : ""), - socketType: server.socketType, - authMethod: server.authMethod, - smtpServers: this._getSMTPDetails(account), - }); + try { + const server = account.incomingServer; + accountDetails.push({ + key: account.key, + name: server.prettyName, + hostDetails: + "(" + + server.type + + ") " + + server.hostName + + (server.port != -1 ? ":" + server.port : ""), + socketType: server.socketType, + authMethod: server.authMethod, + smtpServers: this._getSMTPDetails(account), + }); + } catch (error) { + // Populate placeholder data. + accountDetails.push({ + key: account.key, + name: error.message, + hostDetails: "", + sokectType: "", + authMethod: "", + smtpServers: [], + }); + } } function idCompare(accountA, accountB) { diff --git a/mailnews/base/prefs/content/AccountManager.js b/mailnews/base/prefs/content/AccountManager.js index bdfbfb9f2f..3e1c3531c9 100644 --- a/mailnews/base/prefs/content/AccountManager.js +++ b/mailnews/base/prefs/content/AccountManager.js @@ -1839,6 +1839,7 @@ var gAccountTree = { let amChrome = "about:blank"; const panelsToKeep = []; let server = null; + let validAccount = true; // This "try {} catch {}" block is intentionally very long to catch // unknown exceptions and confine them to this single account. @@ -1921,6 +1922,7 @@ var gAccountTree = { console.error("Error accessing account " + accountID + ": " + e); accountName = "Invalid account " + accountID; panelsToKeep.length = 0; + validAccount = false; } // Create the top level tree-item. @@ -1940,7 +1942,7 @@ var gAccountTree = { treeitem.classList.add("isSecure"); } // For IM accounts, we can try to fetch a protocol specific icon. - if (server.type == "im") { + if (server.type == "im" && validAccount) { treeitem.querySelector(".icon").style.backgroundImage = "url(" + ChatIcons.getProtocolIconURI(