Skip to content
Snippets Groups Projects
Commit c53661f1 authored by Jean Chalard's avatar Jean Chalard
Browse files

Fix a possible OutOfBoundsException

Change-Id: I6eb13c228738119c78496a96acaedbccefd83cd3
parent 3458d618
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,11 @@ public class AndroidSpellCheckerService extends SpellCheckerService { ...@@ -156,6 +156,11 @@ public class AndroidSpellCheckerService extends SpellCheckerService {
// } // }
return true; return true;
} }
if (insertIndex >= mMaxLength) {
// We found a suggestion, but its score is too weak to be kept considering
// the suggestion limit.
return true;
}
// Compute the normalized score and skip this word if it's normalized score does not // Compute the normalized score and skip this word if it's normalized score does not
// make the threshold. // make the threshold.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment