File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -473,8 +473,16 @@ private class SpellParser {
473473 private Object mRange = new Object ();
474474
475475 public void parse (int start , int end ) {
476- if (end > start ) {
477- setRangeSpan ((Editable ) mTextView .getText (), start , end );
476+ final int max = mTextView .length ();
477+ final int parseEnd ;
478+ if (end > max ) {
479+ Log .w (TAG , "Parse invalid region, from " + start + " to " + end );
480+ parseEnd = max ;
481+ } else {
482+ parseEnd = end ;
483+ }
484+ if (parseEnd > start ) {
485+ setRangeSpan ((Editable ) mTextView .getText (), start , parseEnd );
478486 parse ();
479487 }
480488 }
@@ -612,6 +620,8 @@ public void parse() {
612620 break ;
613621 }
614622 if (spellCheckEnd <= spellCheckStart ) {
623+ Log .w (TAG , "Trying to spellcheck invalid region, from "
624+ + start + " to " + end );
615625 break ;
616626 }
617627 if (createSpellCheckSpan ) {
You can’t perform that action at this time.
0 commit comments