commit 74a816cad78fc360e95ecc3cb9574f0997acef09 Author: Jérémy Bobbio lunar@debian.org Date: Sun Oct 2 10:37:58 2011 +0200
Use nsIPrefLocalizedString only when required in torbutton_get_general_useragent_locale()
Otherwise, Firefox throws an uncatcheable NS_ERROR_UNEXPECTED exception. At least in TBB. Strange, strange.
Fix issue introduced in 84e8dbc9. --- src/chrome/content/torbutton.js | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index a9b8b59..e91ae2a 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -1222,8 +1222,12 @@ function torbutton_set_timezone(mode, startup) {
function torbutton_get_general_useragent_locale() { try { - return m_tb_prefs.getComplexValue("general.useragent.locale", - Components.interfaces.nsIPrefLocalizedString).data; + var locale = m_tb_prefs.getCharPref("general.useragent.locale"); + if (/chrome:///.test(locale)) { + return m_tb_prefs.getComplexValue("general.useragent.locale", + Components.interfaces.nsIPrefLocalizedString).data; + } + return locale; } catch(err) { torbutton_log(4, "Error while getting general.useragent.locale:" + err); return 'en-US';