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

Commit b91f71cb authored by Sneh Bansal's avatar Sneh Bansal Committed by Arne Coucheron
Browse files

Telephony: Fix Crash in SimStatus Fragment

Null pointer exception caused because data connection state change
event triggered before the fragment could attach to the activity.
Add a null check before using the attached activity.

Change-Id: I3d9c8ca55ebcb481ba9de8012e27b592e0b9c0c5
CRs-Fixed: 2007186
parent 0c152cd2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -233,10 +233,12 @@ public class SimStatus extends SettingsPreferenceFragment {

        boolean show4GForLTE = false;
        try {
            if (getActivity() != null) {
                Context con = getActivity().createPackageContext("com.android.systemui", 0);
                int id = con.getResources().getIdentifier("config_show4GForLTE",
                        "bool", "com.android.systemui");
                show4GForLTE = con.getResources().getBoolean(id);
            }
        } catch (NameNotFoundException e) {
            Log.e(TAG, "NameNotFoundException for show4GFotLTE");
        }