mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
fix NPE when version isn't specified
This commit is contained in:
parent
989f6b0d22
commit
ed24df38a8
@ -148,13 +148,13 @@ class WebLogin : WebState {
|
|||||||
webClient.server.addressCallbacks[callback].complete(
|
webClient.server.addressCallbacks[callback].complete(
|
||||||
AddressInfo(
|
AddressInfo(
|
||||||
backVersion = obj["version"].asString.let {
|
backVersion = obj["version"].asString.let {
|
||||||
val output = Ints.tryParse(it)
|
val number = Ints.tryParse(it)
|
||||||
val protocol = if (output == null) {
|
val protocol = if (number == null) {
|
||||||
ProtocolVersion.getClosest(it)
|
ProtocolVersion.getClosest(it)
|
||||||
} else {
|
} else {
|
||||||
ProtocolVersion.getProtocol(output)
|
ProtocolVersion.getProtocol(number)
|
||||||
}
|
} ?: AUTO
|
||||||
if (!protocol!!.isKnown) AUTO else protocol
|
if (!protocol.isKnown) AUTO else protocol
|
||||||
},
|
},
|
||||||
backHostAndPort = HostAndPort.fromParts(obj["host"].asString, obj["port"].asInt),
|
backHostAndPort = HostAndPort.fromParts(obj["host"].asString, obj["port"].asInt),
|
||||||
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
||||||
|
Loading…
Reference in New Issue
Block a user