Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ae25a6a authored by BadDaemon's avatar BadDaemon Committed by Zhao Wei Liew
Browse files

Settings: Fix RuntimeException in InputMethod Settings

Fixes:
java.lang.RuntimeException: Unable to resume activity
{com.android.settings/com.android.settings.SubSettings}:
java.lang.NullPointerException: Attempt to invoke virtual
method 'void android.preference.Preference.onPrepareForRemoval()'
on a null object reference

OnResume calls the method changed with an already removed preference
-> results in null being passed and therefore NPE occurs

Change-Id: Idfca3a79aaaac71dfc872bb012b5fd1b2c247341
parent 15e214ed
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -240,6 +240,9 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
    }

    private void updateUserDictionaryPreference(Preference userDictionaryPreference) {
        if (userDictionaryPreference == null) {
            return;
        }
        final Activity activity = getActivity();
        final TreeSet<String> localeSet = UserDictionaryList.getUserDictionaryLocalesSet(activity);
        if (null == localeSet) {