From faa9e203ee4f5a1ac295f735d9d730e471b61791 Mon Sep 17 00:00:00 2001 From: Matt Reetz Date: Thu, 28 Sep 2023 10:48:05 -0500 Subject: [PATCH] Fix crash when sol balance is undefined. (#485) --- 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)