Fix: UnknownHostException in cinterop command. (#2271)

This commit is contained in:
Dmitriy Dolovov
2018-10-29 14:53:14 +07:00
committed by GitHub
parent 0681c6ce5f
commit 79e595bf0a
@@ -289,17 +289,15 @@ internal object InternalServer {
}
}
private fun checkAccessible(): Boolean {
private fun checkAccessible() = try {
if (!InetAddress.getLocalHost().canonicalHostName.endsWith(".$internalDomain")) {
// Fast path:
return false
}
try {
false
} else {
InetAddress.getByName(host)
return true
} catch (e: UnknownHostException) {
return false
true
}
} catch (e: UnknownHostException) {
false
}
}