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(
|
||||
AddressInfo(
|
||||
backVersion = obj["version"].asString.let {
|
||||
val output = Ints.tryParse(it)
|
||||
val protocol = if (output == null) {
|
||||
val number = Ints.tryParse(it)
|
||||
val protocol = if (number == null) {
|
||||
ProtocolVersion.getClosest(it)
|
||||
} else {
|
||||
ProtocolVersion.getProtocol(output)
|
||||
}
|
||||
if (!protocol!!.isKnown) AUTO else protocol
|
||||
ProtocolVersion.getProtocol(number)
|
||||
} ?: AUTO
|
||||
if (!protocol.isKnown) AUTO else protocol
|
||||
},
|
||||
backHostAndPort = HostAndPort.fromParts(obj["host"].asString, obj["port"].asInt),
|
||||
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
||||
|
Loading…
Reference in New Issue
Block a user