From d5b7a4ed878069e31e6087ed62fcdcf7b5673783 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 26 Feb 2013 11:31:35 -0500 Subject: [PATCH] Bug 845341 - Make sure that PrivateBrowsingUtils.permanentPrivateBrowsing does not throw if the autostart pref doesn't have a default value; r=jdm --- toolkit/content/PrivateBrowsingUtils.jsm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/toolkit/content/PrivateBrowsingUtils.jsm b/toolkit/content/PrivateBrowsingUtils.jsm index 52528d6c98e..f54396adfb5 100644 --- a/toolkit/content/PrivateBrowsingUtils.jsm +++ b/toolkit/content/PrivateBrowsingUtils.jsm @@ -27,8 +27,13 @@ this.PrivateBrowsingUtils = { }, get permanentPrivateBrowsing() { - return gTemporaryAutoStartMode || - Services.prefs.getBoolPref(kAutoStartPref, false); + try { + return gTemporaryAutoStartMode || + Services.prefs.getBoolPref(kAutoStartPref); + } catch (e) { + // The pref does not exist + return false; + } }, // These should only be used from internal code