Merge "Fix: NPE after turning on personalized suggestion."
This commit is contained in:
commit
9f02a67c77
1 changed files with 7 additions and 2 deletions
|
@ -574,6 +574,12 @@ public class DictionaryFacilitator {
|
||||||
final ExpandableBinaryDictionary.AddMultipleDictionaryEntriesCallback callback) {
|
final ExpandableBinaryDictionary.AddMultipleDictionaryEntriesCallback callback) {
|
||||||
final ExpandableBinaryDictionary personalizationDict =
|
final ExpandableBinaryDictionary personalizationDict =
|
||||||
mDictionaries.getSubDict(Dictionary.TYPE_PERSONALIZATION);
|
mDictionaries.getSubDict(Dictionary.TYPE_PERSONALIZATION);
|
||||||
|
if (personalizationDict == null) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onFinished();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
final ArrayList<LanguageModelParam> languageModelParams =
|
final ArrayList<LanguageModelParam> languageModelParams =
|
||||||
LanguageModelParam.createLanguageModelParamsFrom(
|
LanguageModelParam.createLanguageModelParamsFrom(
|
||||||
personalizationDataChunk.mTokens,
|
personalizationDataChunk.mTokens,
|
||||||
|
@ -581,8 +587,7 @@ public class DictionaryFacilitator {
|
||||||
this /* dictionaryFacilitator */, spacingAndPunctuations,
|
this /* dictionaryFacilitator */, spacingAndPunctuations,
|
||||||
new DistracterFilterCheckingIsInDictionary(
|
new DistracterFilterCheckingIsInDictionary(
|
||||||
mDistracterFilter, personalizationDict));
|
mDistracterFilter, personalizationDict));
|
||||||
if (personalizationDict == null || languageModelParams == null
|
if (languageModelParams == null || languageModelParams.isEmpty()) {
|
||||||
|| languageModelParams.isEmpty()) {
|
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.onFinished();
|
callback.onFinished();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue