Bug 303675 downloads fail silently if the default download path is invalid, e.g. leads to a removed drive

p=me r=cbiesinger sr=neil.parkwaycc.co.uk a=asa
This commit is contained in:
bugzilla%arlen.demon.co.uk 2005-08-08 10:56:34 +00:00
parent 4b6f08e7a3
commit 9b7929c07a
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ nsHelperAppDialog.prototype = {
var autoDownload = branch.getBoolPref("autoDownload");
// If the autoDownload pref is set then just download to default download directory
if (dir && autoDownload) {
if (autoDownload && dir && dir.exists()) {
if (aDefaultFile == "")
aDefaultFile = bundle.GetStringFromName("noDefaultFile") + (aSuggestedFileExtension || "");
dir.append(aDefaultFile);

View File

@ -503,7 +503,7 @@ function poseFilePicker(aFpP)
} catch (e) { }
var autoDownload = branch.getBoolPref("autoDownload");
if (dir && autoDownload) {
if (autoDownload && dir && dir.exists()) {
dir.append(getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt));
aFpP.file = uniqueFile(dir);
return true;