fix: check null
This commit is contained in:
parent
19d4279237
commit
7d56e66a86
|
@ -9,6 +9,7 @@ proc fromEvent*(jsonSignal: JsonNode): Signal =
|
|||
signal.blockNumber = jsonSignal["event"]{"blockNumber"}.getInt
|
||||
signal.erc20 = jsonSignal["event"]{"erc20"}.getBool
|
||||
signal.accounts = @[]
|
||||
if jsonSignal["event"]["accounts"].kind != JNull:
|
||||
for account in jsonSignal["event"]["accounts"]:
|
||||
signal.accounts.add(account.getStr)
|
||||
result = signal
|
||||
|
|
Loading…
Reference in New Issue