commit | 72ac390ce64fe2825ac59029402e5f372303c8c3 | [log] [tgz] |
---|---|---|
author | Tadashi G. Takaoka <takaoka@google.com> | Mon Jun 03 15:35:49 2013 +0900 |
committer | Tadashi G. Takaoka <takaoka@google.com> | Mon Jun 03 15:35:49 2013 +0900 |
tree | a19c38523258df27ef47057f1cc1f3bd81f19f39 | |
parent | 0bf8c0bf09b0e82086af5b9602fa50a7b64f0a25 [diff] |
Fix ArrayIndexOutOfBoundException Change-Id: I243fc4965365680615eed834efe9ae0240e7f2a8
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 2f2ec35..e4c5a06 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 @@ 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();