Merge pull request #12954 from electron/web-dialog-helper

Fix empty description when only one extension is given (GetFileTypesFromAcceptType)
This commit is contained in:
John Kleinschmidt 2018-05-16 10:15:54 -04:00 committed by GitHub
commit e1c374de6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,10 +168,10 @@ file_dialog::Filters GetFileTypesFromAcceptType(
filters.push_back(file_dialog::Filter()); filters.push_back(file_dialog::Filter());
if (valid_type_count > 1 || if (valid_type_count > 1 || (valid_type_count == 1 && description.empty()))
(valid_type_count == 1 && description.empty() && extensions.size() > 1))
description = "Custom Files"; description = "Custom Files";
DCHECK(!description.empty());
filters[0].first = description; filters[0].first = description;
for (const auto& extension : extensions) { for (const auto& extension : extensions) {