From 8f2d0237027fcd7577fc22a311c18c57a23093d3 Mon Sep 17 00:00:00 2001 From: Cuteivist Date: Wed, 13 Mar 2024 14:19:03 +0100 Subject: [PATCH] chore(wallet): Fix crash on changing networks (#13952) --- src/app/modules/main/wallet_section/assets/balances_model.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/modules/main/wallet_section/assets/balances_model.nim b/src/app/modules/main/wallet_section/assets/balances_model.nim index 4af39e52b3..a460361147 100644 --- a/src/app/modules/main/wallet_section/assets/balances_model.nim +++ b/src/app/modules/main/wallet_section/assets/balances_model.nim @@ -27,6 +27,8 @@ QtObject: result.index = index method rowCount(self: BalancesModel, index: QModelIndex = nil): int = + if self.index < 0 or self.index >= self.delegate.getGroupedAccountsAssetsList().len: + return 0 return self.delegate.getGroupedAccountsAssetsList()[self.index].balancesPerAccount.len proc countChanged(self: BalancesModel) {.signal.}