Index: chrome/browser/file_select_helper.cc |
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc |
index 1b7eda1b1f94179b2c8259d72e3dc277b4b00dfa..d6d73f75abf0eaf7c7561b0d071dab69eb496386 100644 |
--- a/chrome/browser/file_select_helper.cc |
+++ b/chrome/browser/file_select_helper.cc |
@@ -301,8 +301,12 @@ void FileSelectHelper::RunFileChooserOnFileThread( |
void FileSelectHelper::RunFileChooserOnUIThread( |
const content::FileChooserParams& params) { |
- if (!render_view_host_ || !tab_contents_) |
+ if (!render_view_host_ || !tab_contents_) { |
+ // If the renderer was destroyed before we started, just cancel the |
+ // operation. |
+ RunFileChooserEnd(); |
return; |
+ } |
if (!select_file_dialog_.get()) |
select_file_dialog_ = SelectFileDialog::Create(this); |