diff options
author | 2011-09-09 09:42:22 +0900 | |
---|---|---|
committer | 2011-09-09 09:42:22 +0900 | |
commit | 8332fd0b81cf8232ca44e698ac3317f358d89ca9 (patch) | |
tree | 896686fbabc287e90979ea0665284ad90f4c0570 /java/src | |
parent | a08a7e99b4133eb6647ddc27ac60d8ee4c9eddba (diff) | |
download | latinime-8332fd0b81cf8232ca44e698ac3317f358d89ca9.tar.gz latinime-8332fd0b81cf8232ca44e698ac3317f358d89ca9.tar.xz latinime-8332fd0b81cf8232ca44e698ac3317f358d89ca9.zip |
Fix potential ArrayIndexOutOfBoundsException
Change-Id: I5dad81fb274cbbcf2c4f106825eecf8e4903461c
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/MoreSuggestionsView.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java index f595510a3..a5ff5330e 100644 --- a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java @@ -67,7 +67,10 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel { @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) { - mListener.onCustomRequest(primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE); + final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE; + if (index >= 0 && index < SuggestionsView.MAX_SUGGESTIONS) { + mListener.onCustomRequest(index); + } } @Override |