Fix NPE during dumpsys ethernet
Handle the case when IpClient wasn't created for network interface which may happen for virtual device Bug: 78482534 Test: dumpsys ethernet Change-Id: I3405dd4f72d4a6444448f0d6ec0497aead07bade
This commit is contained in:
@@ -440,7 +440,12 @@ public class EthernetNetworkFactory extends NetworkFactory {
|
|||||||
NetworkInterfaceState ifaceState = mTrackingInterfaces.get(iface);
|
NetworkInterfaceState ifaceState = mTrackingInterfaces.get(iface);
|
||||||
pw.println(iface + ":" + ifaceState);
|
pw.println(iface + ":" + ifaceState);
|
||||||
pw.increaseIndent();
|
pw.increaseIndent();
|
||||||
ifaceState.mIpClient.dump(fd, pw, args);
|
final IpClient ipClient = ifaceState.mIpClient;
|
||||||
|
if (ipClient != null) {
|
||||||
|
ipClient.dump(fd, pw, args);
|
||||||
|
} else {
|
||||||
|
pw.println("IpClient is null");
|
||||||
|
}
|
||||||
pw.decreaseIndent();
|
pw.decreaseIndent();
|
||||||
}
|
}
|
||||||
pw.decreaseIndent();
|
pw.decreaseIndent();
|
||||||
|
|||||||
Reference in New Issue
Block a user