From 72ac390ce64fe2825ac59029402e5f372303c8c3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 3 Jun 2013 15:35:49 +0900 Subject: [PATCH] Fix ArrayIndexOutOfBoundException Change-Id: I243fc4965365680615eed834efe9ae0240e7f2a8 --- .../latin/suggestions/SuggestionStripLayoutHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 2f2ec3560..e4c5a06a2 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -208,6 +208,9 @@ final class SuggestionStripLayoutHelper { private CharSequence getStyledSuggestedWord(final SuggestedWords suggestedWords, final int indexInSuggestedWords) { + if (indexInSuggestedWords >= suggestedWords.size()) { + return null; + } final String word = suggestedWords.getWord(indexInSuggestedWords); final boolean isAutoCorrect = indexInSuggestedWords == 1 && suggestedWords.willAutoCorrect();