Not always chainId field when parsing

This commit is contained in:
ligi 2022-06-13 10:28:45 +02:00
parent 6789160912
commit 7c083df45f
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D

View File

@ -355,6 +355,6 @@ private fun getNumber(jsonObject: JsonObject, field: String): Long {
return when (val chainId = jsonObject[field]) { return when (val chainId = jsonObject[field]) {
is Int -> chainId.toLong() is Int -> chainId.toLong()
is Long -> chainId is Long -> chainId
else -> throw (Exception("chain_id must be a number")) else -> throw(Exception("not a number at $field"))
} }
} }