Bug 1465458 - Fix launching downloads without a file extension on Windows. r=mak
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Tue, 26 Jun 2018 15:27:36 +0100
changeset 424365 8030bbd5967f
parent 424364 b11aa832c41a
child 424366 1658ec07186e
push id34203
push userebalazs@mozilla.com
push dateFri, 29 Jun 2018 09:42:22 +0000
treeherdermozilla-central@bf149090f6b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1465458
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1465458 - Fix launching downloads without a file extension on Windows. r=mak MozReview-Commit-ID: 6VYjHM46gZx
toolkit/components/downloads/DownloadIntegration.jsm
--- 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.