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

Commit f8396a55 authored by Zoey Chen's avatar Zoey Chen
Browse files

[Settings] Add NPE protection

Bug: 363633142
Change-Id: Ie68d599b79f1247ded2b46afec2f214e23237731
Test: manual
Flag: EXEMPT bugfix
parent fce9512b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Context;
import android.os.Bundle;
import android.os.LocaleList;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -265,6 +266,11 @@ public class LocalePickerWithRegion extends ListFragment implements SearchView.O
    public void onListItemClick(ListView parent, View v, int position, long id) {
        final LocaleStore.LocaleInfo locale =
                (LocaleStore.LocaleInfo) parent.getAdapter().getItem(position);
         if (locale == null) {
            Log.d(TAG, "Can not get the locale.");
            return;
        }

        // Special case for resetting the app locale to equal the system locale.
        boolean isSystemLocale = locale.isSystemLocale();
        boolean isRegionLocale = locale.getParent() != null;