Commit 1f03fb9b authored by anonym's avatar anonym
Browse files

Make the "default search engine" less error prone.

Without the added safeguards an exception will be thrown if
browser.search.defaultenginename is not set, so the Unsafe Browser and
standaline Tor Launcher won't start.

Refs: #12635
parent f7b5d54f
......@@ -220,8 +220,12 @@ EOF
// This file must start with a comment
var searchService = Components.classes["@mozilla.org/browser/search-service;1"].getService(Components.interfaces.nsIBrowserSearchService);
var engineName = getPref("browser.search.defaultenginename");
var engine = searchService.getEngineByName(engineName);
searchService.currentEngine = engine;
if (engineName) {
var engine = searchService.getEngineByName(engineName);
if (engine) {
searchService.currentEngine = engine;
}
}
EOF
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment