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

Commit bad369d6 authored by zhangshuxiao's avatar zhangshuxiao Committed by Shuxiao Zhang
Browse files

[NetworkPolicy]: Fixes the crash issues caused by null pointer.



When handleRegisterNetworkAgent in ConnectivityService,
the networkinfo of NetworkAgentInfo will be set to null.
So we need to handle the null pointer of state.networkInfo.

Change-Id: I2a278f1f1b2455057fd2ed323ff4df340c3cbca9
Signed-off-by: default avatarzhangshuxiao <zhangshuxiao@xiaomi.com>
parent 5b63231a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1206,7 +1206,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
        final ArrayList<Pair<String, NetworkIdentity>> connIdents = new ArrayList<>(states.length);
        final ArraySet<String> connIfaces = new ArraySet<String>(states.length);
        for (NetworkState state : states) {
            if (state.networkInfo.isConnected()) {
            if (state.networkInfo != null && state.networkInfo.isConnected()) {
                final NetworkIdentity ident = NetworkIdentity.buildNetworkIdentity(mContext, state);

                final String baseIface = state.linkProperties.getInterfaceName();