Bug 300561 Handle broken default search engine pref value

Patch by ajschult, r=neil a=asa
This commit is contained in:
cst%andrew.cmu.edu 2005-07-14 01:36:32 +00:00
Родитель 34d2fa2c1d
Коммит 61c31f009d
1 изменённых файлов: 11 добавлений и 6 удалений

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

@ -216,9 +216,9 @@
defaultEngine = this.mPrefs.getComplexValue("browser.search.defaultengine",
Components.interfaces.nsISupportsString).data;
} catch(ex) {
// this will re-invoke updateEngines via the pref observer if the pref changes
this.ensureDefaultEnginePrefs(rdf, ds);
defaultEngine = this.mPrefs.getComplexValue("browser.search.defaultengine",
Components.interfaces.nsISupportsString).data;
return;
}
if (defaultEngine) {
@ -231,10 +231,15 @@
} catch(ex) {
searchBarUrl = null;
}
this.addEngine(res.Value,
this.readRDFString(ds, res, kNC_Name),
this.readRDFString(ds, res, kNC_Icon),
searchBarUrl);
if (searchBarUrl == null) {
// this will re-invoke updateEngines via the pref observer if the pref changes
this.ensureDefaultEnginePrefs(rdf, ds);
return;
}
this.addEngine(res.Value,
this.readRDFString(ds, res, kNC_Name),
this.readRDFString(ds, res, kNC_Icon),
searchBarUrl);
}
}