summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/glue/chrome_client_impl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc
index 4fe6e60..daf9432 100644
--- a/webkit/glue/chrome_client_impl.cc
+++ b/webkit/glue/chrome_client_impl.cc
@@ -444,8 +444,9 @@ void ChromeClientImpl::runOpenPanel(WebCore::Frame* frame,
if (!delegate)
return;
- std::wstring suggestion = webkit_glue::StringToStdWString(
- fileChooser->filenames()[0]);
+ std::wstring suggestion;
+ if (fileChooser->filenames().size() > 0)
+ suggestion = webkit_glue::StringToStdWString(fileChooser->filenames()[0]);
WebFileChooserCallbackImpl* chooser = new WebFileChooserCallbackImpl(fileChooser);
delegate->RunFileChooser(suggestion, chooser);