diff options
author | 2014-11-20 05:32:03 +0000 | |
---|---|---|
committer | 2014-11-20 05:32:03 +0000 | |
commit | d0fea7bebf9e80f770b64485c2e04d5806386eb0 (patch) | |
tree | dfc64d920a970ea6b835440e2f5e8313f96f4216 /java/src/com/android/inputmethod/latin/DictionaryFacilitator.java | |
parent | cb0a34c40806bcf488559699eb4048b38aebe29a (diff) | |
parent | 1d80cb230180305a173add2fe30b14cefc597126 (diff) | |
download | latinime-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/src/com/android/inputmethod/latin/DictionaryFacilitator.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/DictionaryFacilitator.java | 6 |
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 = |