am 2140d1de: Merge "Avoid system_server crashing due to mac address is null"

* commit '2140d1de47579db839b6a4ccc87394e80449d7a6':
  Avoid system_server crashing due to mac address is null
This commit is contained in:
Irfan Sheriff
2012-08-22 11:01:03 -07:00
committed by Android Git Automerger

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) {