Bug 305679 please look before leaping for mimeInfo.primaryExtension

also enforcing catch...{/}
r=neil sr=neil


git-svn-id: svn://10.0.0.236/trunk@179531 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
timeless%mozdev.org
2005-09-02 04:48:28 +00:00
parent 951e5546d7
commit 2c8cc3e0cd

View File

@@ -500,7 +500,8 @@ function poseFilePicker(aFpP)
// Try and pull in download directory pref
try {
dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
} catch (e) { }
} catch (e) {
}
var autoDownload = branch.getBoolPref("autoDownload");
if (autoDownload && dir && dir.exists()) {
@@ -519,7 +520,8 @@ function poseFilePicker(aFpP)
try {
if (dir.exists())
fp.displayDirectory = dir;
} catch (e) { }
} catch (e) {
}
fp.defaultExtension = aFpP.fileInfo.fileExt;
fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName,
@@ -888,13 +890,14 @@ function getDefaultExtension(aFilename, aURI, aContentType)
}
else {
try {
return mimeInfo.primaryExtension;
if (mimeInfo)
return mimeInfo.primaryExtension;
}
catch (e) {
// Fall back on the extensions in the filename and URI for lack
// of anything better.
return ext || urlext;
}
// Fall back on the extensions in the filename and URI for lack
// of anything better.
return ext || urlext;
}
}