зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
78eb26c122
Коммит
935768b349
|
@ -2681,7 +2681,13 @@ SearchService.prototype = {
|
|||
get _originalDefaultEngine() {
|
||||
let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
|
||||
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);
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче