aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-11-20 05:32:03 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-20 05:32:03 +0000
commitd0fea7bebf9e80f770b64485c2e04d5806386eb0 (patch)
treedfc64d920a970ea6b835440e2f5e8313f96f4216 /java
parentcb0a34c40806bcf488559699eb4048b38aebe29a (diff)
parent1d80cb230180305a173add2fe30b14cefc597126 (diff)
downloadlatinime-d0fea7bebf9e80f770b64485c2e04d5806386eb0.tar.gz
latinime-d0fea7bebf9e80f770b64485c2e04d5806386eb0.tar.xz
latinime-d0fea7bebf9e80f770b64485c2e04d5806386eb0.zip
am 1d80cb23: Merge "Fix a NPE"
* commit '1d80cb230180305a173add2fe30b14cefc597126': Fix a NPE
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryFacilitator.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
index d23639a0d..b24fdea55 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
@@ -266,6 +266,12 @@ public class DictionaryFacilitator {
}
final DictionaryGroup newMostProbableDictionaryGroup =
findDictionaryGroupWithLocale(mDictionaryGroups, locale);
+ if (null == newMostProbableDictionaryGroup) {
+ // It seems this may happen as a race condition; pressing the globe key and space
+ // in quick succession could commit a word out of a dictionary that's not in the
+ // facilitator any more. In this case, just not changing things is fine.
+ return;
+ }
mMostProbableDictionaryGroup.mWeightForTypingInLocale =
DictionaryGroup.WEIGHT_FOR_TYPING_IN_NOT_MOST_PROBABLE_LANGUAGE;
mMostProbableDictionaryGroup.mWeightForGesturingInLocale =