Fix IndexOutOfBoundsException in LatinIME.setSuggestions

bug: 4369728
Change-Id: I7f8b09ecf7fb096bdff73b2d3575ed3779ed120d
This commit is contained in:
Ken Wakasa 2011-05-06 13:52:07 +09:00
parent 80bcf30dd6
commit ec5ae3a1b6

View file

@ -179,7 +179,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
private void updateSuggestions() {
final SuggestedWords suggestions = mSuggestions;
clear();
final int count = suggestions.size();
final int count = Math.min(mWords.size(), suggestions.size());
for (int i = 0; i < count; i++) {
CharSequence word = suggestions.getWord(i);
if (word == null) continue;