Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2444)

Unified Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 7764003: Fix a crash caused by unknown saved language. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate.cc
===================================================================
--- chrome/browser/translate/translate_infobar_delegate.cc (revision 98105)
+++ chrome/browser/translate/translate_infobar_delegate.cc (working copy)
@@ -89,6 +89,7 @@
void TranslateInfoBarDelegate::SetTargetLanguage(size_t language_index) {
DCHECK_LT(language_index, GetLanguageCount());
+ DCHECK_GE(language_index, 0U);
target_language_index_ = language_index;
if (infobar_view_)
infobar_view_->TargetLanguageChanged();
@@ -348,6 +349,7 @@
if (language_code == target_language)
target_language_index_ = iter - languages_.begin();
}
+ DCHECK_NE(kNoIndex, target_language_index_);
}
bool TranslateInfoBarDelegate::ShouldExpire(
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698