From 40fc72376411587e7bf9985fb9545eca1c9aaa8e Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Sat, 13 Apr 2019 17:27:59 -0400 Subject: Pref try/catch block fixup. Tag #991. --- toolkit/components/search/current/nsSearchService.js | 13 ++++++++----- toolkit/components/search/orginal/nsSearchService.js | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'toolkit/components') diff --git a/toolkit/components/search/current/nsSearchService.js b/toolkit/components/search/current/nsSearchService.js index 66866540a..db90e5150 100644 --- a/toolkit/components/search/current/nsSearchService.js +++ b/toolkit/components/search/current/nsSearchService.js @@ -983,11 +983,14 @@ function ParamSubstitution(aParamValue, aSearchTerms, aEngine) { var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID", Services.appinfo.distributionID || ""); - var official; - if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official", MOZ_OFFICIAL)) - official = "official"; - else - official = "unofficial"; + var official = MOZ_OFFICIAL; + try { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official")) + official = "official"; + else + official = "unofficial"; + } + catch (ex) { } // Custom search parameters. These are only available to default search // engines. diff --git a/toolkit/components/search/orginal/nsSearchService.js b/toolkit/components/search/orginal/nsSearchService.js index c4481df5f..1cec5f966 100644 --- a/toolkit/components/search/orginal/nsSearchService.js +++ b/toolkit/components/search/orginal/nsSearchService.js @@ -1024,11 +1024,14 @@ function ParamSubstitution(aParamValue, aSearchTerms, aEngine) { var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID", MOZ_DISTRIBUTION_ID || ""); - var official; - if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official", MOZ_OFFICIAL)) - official = "official"; - else - official = "unofficial"; + var official = MOZ_OFFICIAL; + try { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official")) + official = "official"; + else + official = "unofficial"; + } + catch (ex) { } // Custom search parameters. These are only available to default search // engines. -- cgit v1.2.3