Merge "Avoid system_server crashing due to mac address is null"

This commit is contained in:
Irfan Sheriff
2012-08-22 10:48:23 -07:00
committed by android code review

View File

@@ -53,9 +53,11 @@ public class ArpPeer {
mInterfaceName = interfaceName;
mMyAddr = myAddr;
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
i*3, (i*3) + 2), 16);
if (mac != null) {
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
i*3, (i*3) + 2), 16);
}
}
if (myAddr instanceof Inet6Address || peer instanceof Inet6Address) {