summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpaul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 18:51:51 +0000
committerpaul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 18:51:51 +0000
commit01fab8b94bf539331104f3e2adffc4933766d362 (patch)
treedd5d34b4c092ef515449086aef87484efee689c6 /chrome
parent57644767de98ad87692dfae268858fb24ec66d15 (diff)
downloadchromium_src-01fab8b94bf539331104f3e2adffc4933766d362.zip
chromium_src-01fab8b94bf539331104f3e2adffc4933766d362.tar.gz
chromium_src-01fab8b94bf539331104f3e2adffc4933766d362.tar.bz2
Set the save file type index properly if there was only one file type.
The save file indexes are 1 based, and if there is only one file type that the page can be saved as (such as a page like foo.com/notes.txt), the index is set to 0 which will cause a crash. BUG=15555 (http://crbug.com/15555) TEST=Go to a web page that is a text file and try to save it. Chrome should not crash. Review URL: http://codereview.chromium.org/155264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/shell_dialogs_mac.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/shell_dialogs_mac.mm b/chrome/browser/cocoa/shell_dialogs_mac.mm
index 400a848..9b58360 100644
--- a/chrome/browser/cocoa/shell_dialogs_mac.mm
+++ b/chrome/browser/cocoa/shell_dialogs_mac.mm
@@ -326,6 +326,8 @@ NSView* SelectFileDialogImpl::GetAccessoryView(const FileTypeInfo* file_types,
// File type indexes are 1-based.
index = [popup indexOfSelectedItem] + 1;
}
+ } else {
+ index = 1;
}
} else {
NSArray* filenames = [panel filenames];