fix(@desktop/wallet): prevent collectibles controller crash if network unknown

This commit is contained in:
Dario Gabriel Lipicar 2024-04-02 13:31:20 -03:00 committed by dlipicar
parent 7dea2e248c
commit 1884f6e033
2 changed files with 4 additions and 2 deletions

View File

@ -55,7 +55,8 @@ QtObject:
proc getExtraData(self: Controller, chainID: int): ExtraData =
let network = self.networkService.getNetworkByChainId(chainID)
return getExtraData(network)
if not network.isNil:
return getExtraData(network)
proc processGetCollectiblesDetailsResponse(self: Controller, response: JsonNode) =
defer: self.setIsDetailedEntryLoading(false)

View File

@ -152,7 +152,8 @@ QtObject:
proc getExtraData(self: Controller, chainID: int): ExtraData =
let network = self.networkService.getNetworkByChainId(chainID)
return getExtraData(network)
if not network.isNil:
return getExtraData(network)
proc setTempItems(self: Controller, newItems: seq[CollectiblesEntry], offset: int) =
if offset == 0: