Fix ArrayIndexOutOfBoundException
Change-Id: I243fc4965365680615eed834efe9ae0240e7f2a8main
parent
0bf8c0bf09
commit
72ac390ce6
|
@ -208,6 +208,9 @@ final class SuggestionStripLayoutHelper {
|
||||||
|
|
||||||
private CharSequence getStyledSuggestedWord(final SuggestedWords suggestedWords,
|
private CharSequence getStyledSuggestedWord(final SuggestedWords suggestedWords,
|
||||||
final int indexInSuggestedWords) {
|
final int indexInSuggestedWords) {
|
||||||
|
if (indexInSuggestedWords >= suggestedWords.size()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final String word = suggestedWords.getWord(indexInSuggestedWords);
|
final String word = suggestedWords.getWord(indexInSuggestedWords);
|
||||||
final boolean isAutoCorrect = indexInSuggestedWords == 1
|
final boolean isAutoCorrect = indexInSuggestedWords == 1
|
||||||
&& suggestedWords.willAutoCorrect();
|
&& suggestedWords.willAutoCorrect();
|
||||||
|
|
Loading…
Reference in New Issue