From a0bc3dba3811654ba11d6494f273d868e6c6ce7b Mon Sep 17 00:00:00 2001 From: antonis-bc Date: Thu, 8 Dec 2022 21:06:47 +0200 Subject: [PATCH] ignore assets with null price --- .../android/walletmode/WalletModeBalanceRepository.kt | 2 +- .../data/balances/UnifiedBalancesRepository.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/piuk/blockchain/android/walletmode/WalletModeBalanceRepository.kt b/app/src/main/java/piuk/blockchain/android/walletmode/WalletModeBalanceRepository.kt index 0433c79941..06f872f84c 100644 --- a/app/src/main/java/piuk/blockchain/android/walletmode/WalletModeBalanceRepository.kt +++ b/app/src/main/java/piuk/blockchain/android/walletmode/WalletModeBalanceRepository.kt @@ -17,7 +17,7 @@ import kotlinx.coroutines.flow.combine import piuk.blockchain.android.ui.dashboard.WalletModeBalanceCache class WalletModeBalanceRepository( - private var walletModeService: WalletModeService, + private val walletModeService: WalletModeService, private val balanceStore: WalletModeBalanceCache, private val currencyPrefs: CurrencyPrefs, ) : WalletModeBalanceService { diff --git a/unifiedcryptowallet/data/src/main/java/com/blockchain/unifiedcryptowallet/data/balances/UnifiedBalancesRepository.kt b/unifiedcryptowallet/data/src/main/java/com/blockchain/unifiedcryptowallet/data/balances/UnifiedBalancesRepository.kt index a762ec5a0e..540c55479b 100644 --- a/unifiedcryptowallet/data/src/main/java/com/blockchain/unifiedcryptowallet/data/balances/UnifiedBalancesRepository.kt +++ b/unifiedcryptowallet/data/src/main/java/com/blockchain/unifiedcryptowallet/data/balances/UnifiedBalancesRepository.kt @@ -57,6 +57,7 @@ internal class UnifiedBalancesRepository( else it.currency == wallet.currency.networkTicker && it.account.index == wallet.index && it.account.name == wallet.label }.mapNotNull { + if (it.price == null) return@mapNotNull null val cc = assetCatalogue.fromNetworkTicker(it.currency) NetworkBalance( currency = cc ?: return@mapNotNull null,