diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-04 22:12:22 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-04 22:12:22 +0000 |
commit | ab3422bb7b0900388cbac04fb5ef01e041e8cdb4 (patch) | |
tree | 5c189520cec7312ef8aa5c6840ace5bb72462c16 /chrome | |
parent | 252873ef94051e50ea9cb3a4e8fa1e1d17aef384 (diff) | |
download | chromium_src-ab3422bb7b0900388cbac04fb5ef01e041e8cdb4.zip chromium_src-ab3422bb7b0900388cbac04fb5ef01e041e8cdb4.tar.gz chromium_src-ab3422bb7b0900388cbac04fb5ef01e041e8cdb4.tar.bz2 |
Fix a bug where we try to reference a floating view after
its corresponding object has been removed via the "Clear
browsing data" command.
BUG=1270230
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/download_tab_view.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/download_tab_view.cc b/chrome/browser/download_tab_view.cc index ab3d73a..5f76810 100644 --- a/chrome/browser/download_tab_view.cc +++ b/chrome/browser/download_tab_view.cc @@ -812,7 +812,12 @@ bool DownloadTabView::GetFloatingViewIDForPoint(int x, int y, int* id) { } ChromeViews::View* DownloadTabView::CreateFloatingViewForIndex(int index) { - DCHECK(index < static_cast<int>(downloads_.size())); + if (index >= static_cast<int>(downloads_.size())) { + // It's possible that the downloads have been cleared via the "Clear + // Browsing Data" command, so this index is gone. + return NULL; + } + DownloadItemTabView* dl = new DownloadItemTabView(); dl->SetModel(downloads_[index], this); int row = static_cast<int>(downloads_.size()) - 1 - index; |