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

Unified Diff: chrome/renderer/spellchecker/spellcheck_worditerator.cc

Issue 11413054: [Spellcheck] Don't initialize SpellcheckWordIterator with empty rulesets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/renderer/spellchecker/spellcheck_worditerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_worditerator.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator.cc b/chrome/renderer/spellchecker/spellcheck_worditerator.cc
index d6e6abe1db9911d2fb172c0fcf3c83c294676ebc..466ac5dd304ee0962e6d270ebb136b0f2e489b5a 100644
--- a/chrome/renderer/spellchecker/spellcheck_worditerator.cc
+++ b/chrome/renderer/spellchecker/spellcheck_worditerator.cc
@@ -312,6 +312,11 @@ bool SpellcheckWordIterator::Initialize(
UErrorCode open_status = U_ZERO_ERROR;
UParseError parse_status;
string16 rule(attribute->GetRuleSet(allow_contraction));
+
+ // If there is no rule set, the attributes were invalid.
+ if (rule.empty())
+ return false;
+
iterator_ = ubrk_openRules(rule.c_str(), rule.length(), NULL, 0,
&parse_status, &open_status);
if (U_FAILURE(open_status))
« no previous file with comments | « no previous file | chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698