mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 14:54:48 +00:00
fix(@desktop/wallet2): Ensure app not crash when loading collectibles
fails
This commit is contained in:
parent
067ed7b255
commit
77927da284
@ -88,7 +88,7 @@ QtObject:
|
|||||||
proc setCollectionsList(self: CollectiblesView, raw: string) {.slot.} =
|
proc setCollectionsList(self: CollectiblesView, raw: string) {.slot.} =
|
||||||
var newData: seq[OpenseaCollection] = @[]
|
var newData: seq[OpenseaCollection] = @[]
|
||||||
let collectionsJSON = parseJson(raw)
|
let collectionsJSON = parseJson(raw)
|
||||||
if collectionsJSON["result"].kind != JNull:
|
if not collectionsJSON{"result"}.isNil and collectionsJSON{"result"}.kind != JNull:
|
||||||
for jsonOpenseaCollection in collectionsJSON{"result"}:
|
for jsonOpenseaCollection in collectionsJSON{"result"}:
|
||||||
let collection = jsonOpenseaCollection.toOpenseaCollection()
|
let collection = jsonOpenseaCollection.toOpenseaCollection()
|
||||||
newData.add(collection)
|
newData.add(collection)
|
||||||
@ -110,7 +110,7 @@ QtObject:
|
|||||||
proc setAssetsList(self: CollectiblesView, raw: string) {.slot.} =
|
proc setAssetsList(self: CollectiblesView, raw: string) {.slot.} =
|
||||||
var newData: seq[OpenseaAsset] = @[]
|
var newData: seq[OpenseaAsset] = @[]
|
||||||
let assetsJSON = parseJson(raw)
|
let assetsJSON = parseJson(raw)
|
||||||
if assetsJSON{"assets"}{"result"}.kind != JNull:
|
if not assetsJSON{"assets"}{"result"}.isNil and assetsJSON{"assets"}{"result"}.kind != JNull:
|
||||||
for jsonOpenseaAsset in assetsJSON{"assets"}{"result"}:
|
for jsonOpenseaAsset in assetsJSON{"assets"}{"result"}:
|
||||||
newData.add(jsonOpenseaAsset.toOpenseaAsset())
|
newData.add(jsonOpenseaAsset.toOpenseaAsset())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user