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

This commit is contained in:
scott%scott-macgregor.org 2006-11-22 18:48:36 +00:00
Родитель a14d9fada6
Коммит ec47273273
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -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");

Просмотреть файл

@ -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))
{