From 25013fa998633d93c253308ca1b959098d3c783c Mon Sep 17 00:00:00 2001 From: "gijskruitbosch%gmail.com" Date: Sat, 3 May 2008 15:41:25 +0000 Subject: [PATCH] Bug 418722 - Browse... button in pref window should work if pref is invalid r=silver@warwickcompsoc.co.uk (James Ross) a=NPOTB (ChatZilla Only) git-svn-id: svn://10.0.0.236/trunk@251134 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/irc/xul/content/config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/extensions/irc/xul/content/config.js b/mozilla/extensions/irc/xul/content/config.js index 30a98fcd50f..852172f7c3c 100755 --- a/mozilla/extensions/irc/xul/content/config.js +++ b/mozilla/extensions/irc/xul/content/config.js @@ -1384,7 +1384,16 @@ function pwin_onPrefBrowse(button) var rv; if (type == "folder") { - var current = getFileFromURLSpec(edit.value); + try + { + // if the user set the pref to an invalid folder, this will throw: + var current = getFileFromURLSpec(edit.value); + } + catch (ex) + { + // Just setting it to null will work: + current = null; + } rv = pickGetFolder(MSG_PREFS_BROWSE_TITLE, current); } else