Merge "Bug 5385279: IOOB in createMisspelledSuggestionSpan"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b10d396f2e
@@ -239,6 +239,7 @@ public class SpellChecker implements SpellCheckerSessionListener {
|
|||||||
SuggestionsInfo suggestionsInfo, SpellCheckSpan spellCheckSpan) {
|
SuggestionsInfo suggestionsInfo, SpellCheckSpan spellCheckSpan) {
|
||||||
final int start = editable.getSpanStart(spellCheckSpan);
|
final int start = editable.getSpanStart(spellCheckSpan);
|
||||||
final int end = editable.getSpanEnd(spellCheckSpan);
|
final int end = editable.getSpanEnd(spellCheckSpan);
|
||||||
|
if (start < 0 || end < 0) return; // span was removed in the meantime
|
||||||
|
|
||||||
// Other suggestion spans may exist on that region, with identical suggestions, filter
|
// Other suggestion spans may exist on that region, with identical suggestions, filter
|
||||||
// them out to avoid duplicates. First, filter suggestion spans on that exact region.
|
// them out to avoid duplicates. First, filter suggestion spans on that exact region.
|
||||||
|
|||||||
Reference in New Issue
Block a user