Merge pull request #12954 from electron/web-dialog-helper
Fix empty description when only one extension is given (GetFileTypesFromAcceptType)
This commit is contained in:
commit
e1c374de6e
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue