From 9808d76e85badcfac8d7ab15a24ab5de4a6849d5 Mon Sep 17 00:00:00 2001 From: Matt Reetz Date: Thu, 28 Sep 2023 10:13:57 -0500 Subject: [PATCH] Fix crash when sol balance is undefined. --- src/utils/Balance.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/Balance.tsx b/src/utils/Balance.tsx index 283ccf159..d74f59038 100644 --- a/src/utils/Balance.tsx +++ b/src/utils/Balance.tsx @@ -136,7 +136,7 @@ const useBalanceHook = () => { const solToken = accountBalancesForCluster?.sol - const solBalance = solToken?.balance + const solBalance = solToken?.balance || 0 const solPrice = tokenPrices?.solana?.[currency] || 0 const solValue = solPrice * (solBalance / LAMPORTS_PER_SOL) const formattedSolValue = await CurrencyFormatter.format(solValue, currency)