Index: ui/shell_dialogs/select_file_dialog_android.cc |
diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/select_file_dialog_android.cc |
index 2aa40073a028b14f4df5eb2bb98a046c0e2b8a68..6bed380d354721488e0680ad9c9639fbab03e6b2 100644 |
--- a/ui/shell_dialogs/select_file_dialog_android.cc |
+++ b/ui/shell_dialogs/select_file_dialog_android.cc |
@@ -62,15 +62,20 @@ void SelectFileDialogImpl::SelectFileImpl( |
void* params) { |
JNIEnv* env = base::android::AttachCurrentThread(); |
- std::vector<string16> accept_types = |
- *(reinterpret_cast<std::vector<string16>*>(params)); |
- |
- // The last string in params is expected to be the string with capture value. |
- ScopedJavaLocalRef<jstring> capture_value = |
- base::android::ConvertUTF16ToJavaString(env, |
+ ScopedJavaLocalRef<jstring> capture_value; |
+ std::vector<string16> accept_types; |
+ if (params) { |
+ accept_types = *(reinterpret_cast<std::vector<string16>*>(params)); |
+ |
+ // The last string in params is expected to be the string |
+ // with capture value. |
+ capture_value = base::android::ConvertUTF16ToJavaString(env, |
StringToLowerASCII(accept_types.back())); |
- base::android::CheckException(env); |
- accept_types.pop_back(); |
+ base::android::CheckException(env); |
+ accept_types.pop_back(); |
+ } else { |
+ capture_value = base::android::ConvertUTF8ToJavaString(env, "filesystem"); |
+ } |
// The rest params elements are expected to be accept_types. |
ScopedJavaLocalRef<jobjectArray> accept_types_java = |