|
|
@@ -507,9 +507,12 @@ public class NetUtil {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- byte[] mac;
|
|
|
+ byte[] mac = null;
|
|
|
try {
|
|
|
- mac = NetworkInterface.getByInetAddress(inetAddress).getHardwareAddress();
|
|
|
+ final NetworkInterface networkInterface = NetworkInterface.getByInetAddress(inetAddress);
|
|
|
+ if(null != networkInterface){
|
|
|
+ mac = networkInterface.getHardwareAddress();
|
|
|
+ }
|
|
|
} catch (SocketException e) {
|
|
|
throw new UtilException(e);
|
|
|
}
|
|
|
@@ -526,6 +529,7 @@ public class NetUtil {
|
|
|
}
|
|
|
return sb.toString();
|
|
|
}
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|