chore: cleanup collectibles file

Co-authored-by: RichΛrd <info@richardramos.me>
This commit is contained in:
Jonathan Rainville 2020-09-28 11:25:23 -04:00 committed by Iuri Matias
parent 42102bdae4
commit f19bfb7ca7
1 changed files with 7 additions and 7 deletions

View File

@ -78,16 +78,16 @@ proc getCryptoKittiesBatch*(address: Address, offset: int = 0): seq[Collectible]
var name = kitty["name"]
var finalId = ""
var finalName = ""
if (not (id.kind == JNull)):
if id.kind != JNull:
finalId = $id
if (not (name.kind == JNull)):
if name.kind != JNull:
finalName = $name
cryptokitties.add(Collectible(id: finalId,
name: finalName,
image: kitty["image_url_png"].str,
collectibleType: CRYPTOKITTY,
description: "",
externalUrl: ""))
name: finalName,
image: kitty["image_url_png"].str,
collectibleType: CRYPTOKITTY,
description: "",
externalUrl: ""))
except Exception as e2:
error "Error with this individual cat", msg = e2.msg, cat = kitty