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

Commit a07c7298 authored by jianhuac's avatar jianhuac
Browse files

Settings: Fix crash on WifiAdvancedSetting

When back to WifiAdvancedSetting from "WLAN Direc"
or "Install certificates",Settings app will crash
due to try to remove a null preference.

We should check if the preference is null before
remove it.

Change-Id: I7d67b44b0391679e509890bf5aa4b30cad1e5258
CRs-Fixed: 1059802
parent 453baf4b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -153,8 +153,10 @@ public class AdvancedWifiSettings extends RestrictedSettingsFragment
            enableHs2.setChecked(Settings.Global.getInt(getContentResolver(),
                    Settings.Global.WIFI_HOTSPOT2_ENABLED, WIFI_HS2_DISABLED) == WIFI_HS2_ENABLED);
        } else {
            if(enableHs2 != null){
                getPreferenceScreen().removePreference(enableHs2);
            }
        }

        Intent wifiDirectIntent = new Intent(context,
                com.android.settings.Settings.WifiP2pSettingsActivity.class);