Bug 1465458 - Fix launching downloads without a file extension on Windows. r=mak
MozReview-Commit-ID: 6VYjHM46gZx
--- a/toolkit/components/downloads/DownloadIntegration.jsm
+++ b/toolkit/components/downloads/DownloadIntegration.jsm
@@ -590,17 +590,17 @@ var DownloadIntegration = {
// handle multiple extensions.
let fileExtension = null, mimeInfo = null;
let match = file.leafName.match(/\.([^.]+)$/);
if (match) {
fileExtension = match[1];
}
let isWindowsExe = AppConstants.platform == "win" &&
- fileExtension.toLowerCase() == "exe";
+ fileExtension && fileExtension.toLowerCase() == "exe";
// Ask for confirmation if the file is executable, except for .exe on
// Windows where the operating system will show the prompt based on the
// security zone. We do this here, instead of letting the caller handle
// the prompt separately in the user interface layer, for two reasons. The
// first is because of its security nature, so that add-ons cannot forget
// to do this check. The second is that the system-level security prompt
// would be displayed at launch time in any case.