am 1d80cb23: Merge "Fix a NPE"

* commit '1d80cb230180305a173add2fe30b14cefc597126':
  Fix a NPE
main
Jean Chalard 2014-11-20 05:32:03 +00:00 committed by Android Git Automerger
commit d0fea7bebf
1 changed files with 6 additions and 0 deletions

View File

@ -266,6 +266,12 @@ public class DictionaryFacilitator {
} }
final DictionaryGroup newMostProbableDictionaryGroup = final DictionaryGroup newMostProbableDictionaryGroup =
findDictionaryGroupWithLocale(mDictionaryGroups, locale); 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 = mMostProbableDictionaryGroup.mWeightForTypingInLocale =
DictionaryGroup.WEIGHT_FOR_TYPING_IN_NOT_MOST_PROBABLE_LANGUAGE; DictionaryGroup.WEIGHT_FOR_TYPING_IN_NOT_MOST_PROBABLE_LANGUAGE;
mMostProbableDictionaryGroup.mWeightForGesturingInLocale = mMostProbableDictionaryGroup.mWeightForGesturingInLocale =