fix: check null

This commit is contained in:
Richard Ramos 2021-04-21 13:35:29 -04:00 committed by Iuri Matias
parent 19d4279237
commit 7d56e66a86
1 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,8 @@ proc fromEvent*(jsonSignal: JsonNode): Signal =
signal.blockNumber = jsonSignal["event"]{"blockNumber"}.getInt
signal.erc20 = jsonSignal["event"]{"erc20"}.getBool
signal.accounts = @[]
for account in jsonSignal["event"]["accounts"]:
signal.accounts.add(account.getStr)
if jsonSignal["event"]["accounts"].kind != JNull:
for account in jsonSignal["event"]["accounts"]:
signal.accounts.add(account.getStr)
result = signal