Mac: Fix crash with input element of type "file" when the default file name is empty (issue #823).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1023 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-01-18 17:23:56 +00:00
parent fc0fd84371
commit 3b834de6bb
1 changed files with 4 additions and 2 deletions

View File

@ -529,8 +529,10 @@ bool BrowserWebViewDelegate::ShowFileChooser(std::vector<FilePath>& file_names,
withObject:default_dir
withObject:default_filename];
} else {
[dialog setDirectoryURL:[NSURL URLWithString:default_dir]];
[dialog setNameFieldStringValue:default_filename];
if (default_dir)
[dialog setDirectoryURL:[NSURL URLWithString:default_dir]];
if (default_filename)
[dialog setNameFieldStringValue:default_filename];
result = [dialog runModal];
}