diff --git a/mozilla/mail/base/content/msgMail3PaneWindow.js b/mozilla/mail/base/content/msgMail3PaneWindow.js index c63456cac54..9598a4c6302 100644 --- a/mozilla/mail/base/content/msgMail3PaneWindow.js +++ b/mozilla/mail/base/content/msgMail3PaneWindow.js @@ -888,12 +888,15 @@ function delayedOnLoadMessenger() #ifdef HAVE_SHELL_SERVICE var nsIShellService = Components.interfaces.nsIShellService; - var shellService = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService); + var shellService; + try { + shellService = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService); + } catch (ex) {} // show the default client dialog only if we have at least one account, // if we should check for the default client, // and we aren't already the default for all of our recognized types (mail, news, rss) - if (accountManager.defaultAccount && shellService.shouldCheckDefaultClient + if (shellService && accountManager.defaultAccount && shellService.shouldCheckDefaultClient && !shellService.isDefaultClient(true, nsIShellService.MAIL | nsIShellService.NEWS | nsIShellService.RSS)) window.openDialog("chrome://messenger/content/defaultClientDialog.xul", "DefaultClient", "modal,centerscreen,chrome,resizable=no"); diff --git a/mozilla/mail/components/preferences/general.js b/mozilla/mail/components/preferences/general.js index f97fcbaba62..6bc9fbaa7b7 100644 --- a/mozilla/mail/components/preferences/general.js +++ b/mozilla/mail/components/preferences/general.js @@ -56,7 +56,11 @@ var gGeneralPane = { checkDefaultNow: function (aAppType) { var nsIShellService = Components.interfaces.nsIShellService; - var shellSvc = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService); + var shellSvc; + try { + shellSvc = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService); + } catch (ex) { return; } + // if we are already the default for all the types we handle, then alert the user. if (shellSvc.isDefaultClient(false, nsIShellService.MAIL | nsIShellService.NEWS | nsIShellService.RSS)) {