mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Not always chainId field when parsing
This commit is contained in:
parent
6789160912
commit
7c083df45f
|
@ -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"))
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user