fix secondary locale sometimes not being loaded

This commit is contained in:
Helium 2022-03-20 20:49:43 +01:00
parent 307af99dff
commit 8183de7068

View file

@ -412,8 +412,8 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
// create / load secondary dictionary
final Locale secondaryLocale = Settings.getInstance().getCurrent().mSecondaryLocale;
if (secondaryLocale != null && mainDict != null &&
ScriptUtils.getScriptFromSpellCheckerLocale(secondaryLocale) == ScriptUtils.getScriptFromSpellCheckerLocale(mainDict.mLocale)) {
if (secondaryLocale != null && mDictionaryGroup != null && mDictionaryGroup.mLocale != null &&
ScriptUtils.getScriptFromSpellCheckerLocale(secondaryLocale) == ScriptUtils.getScriptFromSpellCheckerLocale(mDictionaryGroup.mLocale)) {
for (final String subDictType : subDictTypesToUse) {
final ExpandableBinaryDictionary subDict =
getSubDict(subDictType, context, newLocale, null, dictNamePrefix, account);