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

Commit ac7330d1 authored by Yuichiro Hanada's avatar Yuichiro Hanada
Browse files

Set MAC address only when the preference exists.

It can cause NPE because mWifiMacAddress is created only after
displayPreference() is called.

Bug: 199260704
Test: manual - follow the steps in the bug.
Change-Id: I1e9e0c42df24696f0d90928f64387635d8dbf9b9
parent 291d2b44
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -90,6 +90,10 @@ public abstract class AbstractWifiMacAddressPreferenceController
            macAddress = macAddresses[0];
        }

        if (mWifiMacAddress == null) {
            return;
        }

        if (TextUtils.isEmpty(macAddress) || macAddress.equals(WifiInfo.DEFAULT_MAC_ADDRESS)) {
            mWifiMacAddress.setSummary(R.string.status_unavailable);
        } else {