File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
app/src/main/java/net/xcreen/restsms/server Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11package net.xcreen.restsms.server
22
33import java.io.IOException
4- import java.net.InetAddress
54import java.net.NetworkInterface
65import java.util.*
76import javax.servlet.http.HttpServlet
@@ -25,12 +24,12 @@ class SMSWelcomeServlet(private val serverLogging: ServerLogging) : HttpServlet(
2524 response.writer.println (" Server IP Address: $localIpAddress " )
2625 }
2726
28- private fun getLocalIpAddress (): String {
27+ private fun getLocalIpAddress (): String? {
2928 val networkInterfaces = NetworkInterface .getNetworkInterfaces()
3029 for (interfaceElement in Collections .list(networkInterfaces)) {
3130 val inetAddresses = interfaceElement.inetAddresses
3231 for (inetAddress in Collections .list(inetAddresses)) {
33- if (! inetAddress.isLoopbackAddress && inetAddress.hostAddress.indexOf(' :' ) == - 1 ) {
32+ if (! inetAddress.isLoopbackAddress && inetAddress? .hostAddress? .indexOf(' :' ) == - 1 ) {
3433 return inetAddress.hostAddress
3534 }
3635 }
You can’t perform that action at this time.
0 commit comments