diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-04-20 11:17:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-20 11:17:30 +0200 |
commit | e0116ac2b78eb4e621a4d0769e01f8358a6d661c (patch) | |
tree | fe2898874f0be34a8425281ecba2cb8cb59fb210 /application/palemoon/components/nsBrowserGlue.js | |
parent | 32577bdb3d2471c0e5ce4cfd0501a820157230cb (diff) | |
parent | 21b4cb27cabecdb5580c01891801c9259689ec87 (diff) | |
download | UXP-e0116ac2b78eb4e621a4d0769e01f8358a6d661c.tar UXP-e0116ac2b78eb4e621a4d0769e01f8358a6d661c.tar.gz UXP-e0116ac2b78eb4e621a4d0769e01f8358a6d661c.tar.lz UXP-e0116ac2b78eb4e621a4d0769e01f8358a6d661c.tar.xz UXP-e0116ac2b78eb4e621a4d0769e01f8358a6d661c.zip |
Merge pull request #1041 from Ascrod/default-pref
Clean up try/catch blocks for preferences
Diffstat (limited to 'application/palemoon/components/nsBrowserGlue.js')
-rw-r--r-- | application/palemoon/components/nsBrowserGlue.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index ad48dab29..01a133833 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -990,14 +990,8 @@ BrowserGlue.prototype = { // An import operation is about to run. // Don't try to recreate smart bookmarks if autoExportHTML is true or // smart bookmarks are disabled. - var autoExportHTML = false; - try { - autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML"); - } catch(ex) {} - var smartBookmarksVersion = 0; - try { - smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion"); - } catch(ex) {} + var autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); + var smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0); if (!autoExportHTML && smartBookmarksVersion != -1) Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0); @@ -1556,10 +1550,7 @@ BrowserGlue.prototype = { const MAX_RESULTS = 10; // Get current smart bookmarks version. If not set, create them. - let smartBookmarksCurrentVersion = 0; - try { - smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF); - } catch(ex) {} + let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0); // If version is current or smart bookmarks are disabled, just bail out. if (smartBookmarksCurrentVersion == -1 || |