Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
DROPME - Merge pull request #503 from brave/download_dialog_ext
Browse files Browse the repository at this point in the history
Obtain extension from path when no mime type available
  • Loading branch information
bsclifton committed Mar 1, 2018
1 parent 5af7b8a commit d4cad99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion atom/browser/atom_download_manager_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
if (path.empty()) {
std::vector<base::FilePath::StringType> extensions;
base::FilePath::StringType extension;
if (GetItemExtension(item, &extension)) {
if (!GetItemExtension(item, &extension)) {
extension = target_path.Extension();
if (!extension.empty())
extension.erase(extension.begin()); // Erase preceding '.'.
}
if (!extension.empty()) {
extensions.push_back(extension);
file_type_info.extensions.push_back(extensions);
}
Expand Down

0 comments on commit d4cad99

Please sign in to comment.