mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Check the length of the word when add to userhistory.
Change-Id: I7f2fe1771eed6b610704892b24f8a0283a779162
This commit is contained in:
parent
2c0c1cc677
commit
dd435b305e
@ -182,6 +182,10 @@ public class UserHistoryDictionary extends ExpandableDictionary {
|
|||||||
* The second word may not be null (a NullPointerException would be thrown).
|
* The second word may not be null (a NullPointerException would be thrown).
|
||||||
*/
|
*/
|
||||||
public int addToUserHistory(final String word1, String word2, boolean isValid) {
|
public int addToUserHistory(final String word1, String word2, boolean isValid) {
|
||||||
|
if (word2.length() >= BinaryDictionary.MAX_WORD_LENGTH ||
|
||||||
|
(word1 != null && word1.length() >= BinaryDictionary.MAX_WORD_LENGTH)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (mBigramListLock.tryLock()) {
|
if (mBigramListLock.tryLock()) {
|
||||||
try {
|
try {
|
||||||
super.addWord(
|
super.addWord(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user