Fix potential ArrayIndexOutOfBoundsException
Change-Id: I5dad81fb274cbbcf2c4f106825eecf8e4903461c
This commit is contained in:
parent
a08a7e99b4
commit
8332fd0b81
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue