[java] Avoiding NPE, fixes
@@ -88,10 +88,12 @@ private static String resolveHostAddress() {
if (Platform.getCurrent().is(Platform.MAC)) {
try {
NetworkInterface en0 = NetworkInterface.getByName("en0");
+ if (en0 != null) {
Enumeration<InetAddress> addresses = en0.getInetAddresses();
if (addresses.hasMoreElements()) {
address = addresses.nextElement().getHostAddress();
}
+ }
} catch (Throwable e) {
// Fall through and go the slow way.
log.log(WARNING, "Failed to resolve host address", e);
