Bug 1465458 - Fix launching downloads without a file extension on Windows. r=mak, a=RyanVM
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Tue, 26 Jun 2018 15:27:36 +0100
changeset 473794 6b6ded8230f1
parent 473793 dabf33a256d5
child 473795 1b56c49591c5
push id1737
push userryanvm@gmail.com
push date2018-07-02 16:05 +0000
treeherdermozilla-release@ced0b5dc71eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, RyanVM
bugs1465458
milestone61.0.1
Bug 1465458 - Fix launching downloads without a file extension on Windows. r=mak, a=RyanVM 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.