Skip to content

Commit

Permalink
Fix crash when sol balance is undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcarlreetz committed Sep 28, 2023
1 parent 2064628 commit 9808d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/Balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9808d76

Please sign in to comment.