Bug 890085: don't throw in the currentEngine/defaultEngine setters if the defaultenginename pref is invalid, r=mikedeboer

--HG--
extra : transplant_source : I%18%BA%EB%E8%B1%95V%FA%BF%FA%F5L%14%60%BD%FC%A2DK
This commit is contained in:
Gavin Sharp 2013-07-10 14:35:30 -07:00
Родитель 78eb26c122
Коммит 935768b349
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -2681,7 +2681,13 @@ SearchService.prototype = {
get _originalDefaultEngine() { get _originalDefaultEngine() {
let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF); let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
let nsIPLS = Ci.nsIPrefLocalizedString; let nsIPLS = Ci.nsIPrefLocalizedString;
let defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data; let defaultEngine;
try {
defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data;
} catch (ex) {
// If the default pref is invalid (e.g. an add-on set it to a bogus value)
// getEngineByName will just return null, which is the best we can do.
}
return this.getEngineByName(defaultEngine); return this.getEngineByName(defaultEngine);
}, },