fix: fix images sometimes being null

This commit is contained in:
Jonathan Rainville 2020-12-17 15:59:56 -05:00 committed by Iuri Matias
parent d5f3cf71a2
commit 5dcd401cd5
1 changed files with 2 additions and 1 deletions

View File

@ -53,7 +53,8 @@ proc toProfileModel*(profile: JsonNode): Profile =
if profile.hasKey("localNickname"):
result.localNickname = profile["localNickname"].str
if profile.hasKey("images"):
if profile.hasKey("images") and profile["images"].kind != JNull:
if profile["images"].hasKey("thumbnail"):
result.identityImage.thumbnail = profile["images"]["thumbnail"]["uri"].str
if profile["images"].hasKey("large"):