summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_list.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 23:27:50 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 23:27:50 +0000
commitaf9bebd7772e8b11bc6b2f7e908242993540cc5b (patch)
tree1889cfad0b2915c0385f51d356cdc093e2818c07 /chrome/browser/browser_list.cc
parentda32c6762d361c2b3d64a36e12b9607b9bfcc4eb (diff)
downloadchromium_src-af9bebd7772e8b11bc6b2f7e908242993540cc5b.zip
chromium_src-af9bebd7772e8b11bc6b2f7e908242993540cc5b.tar.gz
chromium_src-af9bebd7772e8b11bc6b2f7e908242993540cc5b.tar.bz2
Handling a case where the browser_iterator_ would be NULL. The DCHECK was fine but the code itself was missing the check.
TEST=Run automation tests. BUG=none Review URL: http://codereview.chromium.org/194093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_list.cc')
-rw-r--r--chrome/browser/browser_list.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/browser_list.cc b/chrome/browser/browser_list.cc
index 034bba6..56984a0 100644
--- a/chrome/browser/browser_list.cc
+++ b/chrome/browser/browser_list.cc
@@ -295,11 +295,11 @@ TabContentsIterator::TabContentsIterator()
void TabContentsIterator::Advance() {
// Unless we're at the beginning (index = -1) or end (iterator = end()),
// then the current TabContents should be valid.
- DCHECK(web_view_index_ || browser_iterator_ == BrowserList::end() ||
- cur_) << "Trying to advance past the end";
+ DCHECK(web_view_index_ || browser_iterator_ == BrowserList::end() || cur_)
+ << "Trying to advance past the end";
// Update cur_ to the next TabContents in the list.
- for (;;) {
+ while (browser_iterator_ != BrowserList::end()) {
web_view_index_++;
while (web_view_index_ >= (*browser_iterator_)->tab_count()) {