summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_select_helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/file_select_helper.cc')
-rw-r--r--chrome/browser/file_select_helper.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index a1b31cd..1604b0d 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -166,6 +166,10 @@ SelectFileDialog::FileTypeInfo* FileSelectHelper::GetFileTypesFromAcceptType(
valid_type_count++;
}
+ // If no valid extension is added, bail out.
+ if (valid_type_count == 0)
+ return NULL;
+
// Use a generic description "Custom Files" if either of the following is
// true:
// 1) There're multiple types specified, like "audio/*,video/*"
@@ -227,7 +231,7 @@ void FileSelectHelper::RunFileChooser(
params.title,
default_file_name,
file_types.get(),
- 0,
+ file_types.get() ? 1 : 0, // 1-based index.
FILE_PATH_LITERAL(""),
owning_window,
NULL);