fix(@chat): handle status being nil in stickers

fixes #5195

The attribute Status is marked as omit empty in backend
This commit is contained in:
Anthony Laibe 2022-03-28 10:22:59 +02:00 committed by Iuri Matias
parent 72409d87ce
commit f29e825af4
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ proc toStickerPackDto*(jsonObj: JsonNode): StickerPackDto =
discard jsonObj.getProp("preview", result.preview) discard jsonObj.getProp("preview", result.preview)
discard jsonObj.getProp("thumbnail", result.thumbnail) discard jsonObj.getProp("thumbnail", result.thumbnail)
result.status = jsonObj["status"].getInt(-1).toStickerPackStatus() result.status = jsonObj{"status"}.getInt(0).toStickerPackStatus()
result.price = jsonObj["price"].getStr().parse(Stuint[256]) result.price = jsonObj["price"].getStr().parse(Stuint[256])
result.stickers = @[] result.stickers = @[]
for sticker in jsonObj["stickers"]: for sticker in jsonObj["stickers"]: