aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-12 16:50:58 +0900
committerJean Chalard <jchalard@google.com>2012-03-12 16:50:58 +0900
commitc0c20b386fb06b688f56dd7f807e2bcbb70b3a59 (patch)
treeb0a440ac186a1fa28811a868871496246117e53b /java/src/com/android
parent30936116d888324f8556ffcd92f9ec2751d0ad55 (diff)
downloadlatinime-c0c20b386fb06b688f56dd7f807e2bcbb70b3a59.tar.gz
latinime-c0c20b386fb06b688f56dd7f807e2bcbb70b3a59.tar.xz
latinime-c0c20b386fb06b688f56dd7f807e2bcbb70b3a59.zip
Fix an OOB
The combination of I6b0262fe which removes the internal size() > 1 test in the safety net calculation and I642a5893 which assumed DBG means there is at least one suggestion. This change writes the test correctly. Change-Id: Ib63bce4e163a785f408dd145c23d64cd58fa8c90
Diffstat (limited to 'java/src/com/android')
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
index 462733f96..812376de0 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
@@ -329,7 +329,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
} else {
color = mColorTypedWord;
}
- if (LatinImeLogger.sDBG) {
+ if (LatinImeLogger.sDBG && suggestedWords.size() > 1) {
// If we auto-correct, then the autocorrection is in slot 0 and the typed word
// is in slot 1.
if (index == mCenterSuggestionIndex && suggestedWords.mHasAutoCorrectionCandidate