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

Commit

Permalink
Obtain extension from path when no mime type available
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Feb 22, 2018
1 parent 9453d96 commit c274fec
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 c274fec

Please sign in to comment.