From 871c1f7a63ce3b0b7484f61a73373d608ce29b25 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 30 Aug 2020 17:14:07 -0400 Subject: [PATCH] Server issue maybe java 11? fix #1737 --- .../io/src/main/java/com/rusefi/server/SessionDetails.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/server/SessionDetails.java b/java_console/io/src/main/java/com/rusefi/server/SessionDetails.java index 685d870ee6..152d3156c1 100644 --- a/java_console/io/src/main/java/com/rusefi/server/SessionDetails.java +++ b/java_console/io/src/main/java/com/rusefi/server/SessionDetails.java @@ -37,7 +37,10 @@ public class SessionDetails { private static String findLocalIpAddress() { try { - return InetAddress.getLocalHost().getHostAddress(); + String hostAddress = InetAddress.getLocalHost().getHostAddress(); + if (hostAddress == null) + return "unable to resolve local IP"; + return hostAddress; } catch (UnknownHostException e) { return "unknown"; } @@ -46,7 +49,7 @@ public class SessionDetails { public SessionDetails(NetworkConnector.Implementation implementation, ControllerInfo controllerInfo, String authToken, int oneTimeCode, int consoleVersion, String localIpAddress) { this.implementation = Objects.requireNonNull(implementation); this.consoleVersion = consoleVersion; - this.localIpAddress = localIpAddress; + this.localIpAddress = Objects.requireNonNull(localIpAddress); Objects.requireNonNull(controllerInfo); Objects.requireNonNull(authToken); this.controllerInfo = controllerInfo;