Skip to content

Commit

Permalink
Catch any falsy value
Browse files Browse the repository at this point in the history
  • Loading branch information
MidnightLightning committed Nov 15, 2023
1 parent b981ce8 commit 6dcc73b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/hooks/useGetSourceParsedTokenAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,14 +640,13 @@ const createNFTParsedTokenAccountFromCovalent = (
covalent: CovalentData,
nft_data: CovalentNFTData
): NFTParsedTokenAccount => {
const amount =
nft_data.token_balance == null
? "0"
: formatUnits(nft_data.token_balance, covalent.contract_decimals);
const amount = nft_data.token_balance
? formatUnits(nft_data.token_balance, covalent.contract_decimals)
: "0";
return {
publicKey: walletAddress,
mintKey: covalent.contract_address,
amount: nft_data.token_balance == null ? "" : nft_data.token_balance,
amount: nft_data.token_balance ? nft_data.token_balance : "",
decimals: covalent.contract_decimals,
uiAmount: Number(amount),
uiAmountString: amount,
Expand Down

0 comments on commit 6dcc73b

Please sign in to comment.