conditionally read prefs only to prevent js errors

This commit is contained in:
ben%bengoodger.com 2005-06-24 16:45:37 +00:00
Родитель 60146ef89b
Коммит c60b60ba61
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -454,14 +454,18 @@ UpdateService.prototype = {
*
*/
_initLoggingPrefs: function() {
var ps = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var logBranch = ps.getBranch(PREF_APP_UPDATE_LOG_BRANCH);
var modules = logBranch.getChildList("", { value: 0 });
try {
var ps = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var logBranch = ps.getBranch(PREF_APP_UPDATE_LOG_BRANCH);
var modules = logBranch.getChildList("", { value: 0 });
for (var i = 0; i < modules.length; ++i) {
if (logBranch.prefHasUserValue(modules[i]))
gLogEnabled[modules[i]] = logBranch.getBoolPref(modules[i]);
for (var i = 0; i < modules.length; ++i) {
if (logBranch.prefHasUserValue(modules[i]))
gLogEnabled[modules[i]] = logBranch.getBoolPref(modules[i]);
}
}
catch (e) {
}
},