Skip to content

Commit

Permalink
Bug 1362466 - Skip default handler injection if pref gecko.handlerSer…
Browse files Browse the repository at this point in the history
…vice.defaultHandlersVersion not defined. r=paolo
  • Loading branch information
jorgk3 committed May 7, 2017
1 parent de56fca commit 47862ad
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions uriloader/exthandler/nsHandlerService-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,23 @@ HandlerService.prototype = {
* back-end, we only need to update the version in the data store.
*/
_injectDefaultProtocolHandlersIfNeeded(alreadyInjected) {
let prefsDefaultHandlersVersion;
try {
let locale = Services.locale.getAppLocaleAsLangTag();
let prefsDefaultHandlersVersion = Number(Services.prefs.getComplexValue(
prefsDefaultHandlersVersion = Services.prefs.getComplexValue(
"gecko.handlerService.defaultHandlersVersion",
Ci.nsIPrefLocalizedString).data);
Ci.nsIPrefLocalizedString);
} catch (ex) {
if (ex instanceof Components.Exception &&
ex.result == Cr.NS_ERROR_UNEXPECTED) {
// This platform does not have any default protocol handlers configured.
return;
}
throw ex;
}

try {
prefsDefaultHandlersVersion = Number(prefsDefaultHandlersVersion.data);
let locale = Services.locale.getAppLocaleAsLangTag();

let defaultHandlersVersion =
this._store.data.defaultHandlersVersion[locale] || 0;
Expand Down

0 comments on commit 47862ad

Please sign in to comment.