From 462c59f6efae2b291b4a91606da339ae1f8ebae9 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Wed, 22 Nov 2006 18:52:33 +0000 Subject: [PATCH] Bug #358339 --> wrap attempts to get the shell service in try/catch calls. On some flavors of linux, the initializing the shell service throws an error because we don't have access to the gconf services we are expecting. sr=bienvenu git-svn-id: svn://10.0.0.236/trunk@215693 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mail/base/content/msgMail3PaneWindow.js | 7 +++++-- mozilla/mail/components/preferences/general.js | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) 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)) {