Use a try / catch clause to avoid a JS error for some timeline code.

This commit is contained in:
mscott%netscape.com 2002-01-24 22:59:49 +00:00
Родитель a3bbcae219
Коммит 42c6cc8a40
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -31,9 +31,18 @@ var nsPrefBranch = null;
var gOfflineManager;
var gWindowManagerInterface;
var gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var gTimelineService = Components.classes["@mozilla.org;timeline-service;1"].getService(Components.interfaces.nsITimelineService);
var gTimelineService = null;
var gTimelineEnabled = gPrefs.getBoolPref("mailnews.timeline_is_enabled");
try {
gTimelineService = Components.classes["@mozilla.org;timeline-service;1"].getService(Components.interfaces.nsITimelineService);
}
catch (ex)
{
gTimelineEnabled = false;
}
// Disable the new account menu item if the account preference is locked.
// Two other affected areas are the account central and the account manager
// dialog.