Skip to content

Commit

Permalink
fix: check null value get amount
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Jan 11, 2023
1 parent f640a5a commit 7862f98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/transactions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ export const caculateCosmosTxAmount = (messages: TransactionMessage[]): string =
if (messages && messages.length > 0) {
let totalAmount = BigNumber.from('0')
for (let message of messages) {
console.log(message.content.amount)
totalAmount = totalAmount.add(BigNumber.from(getAstraTokenAmount(message.content?.amount)))
if (message.content?.amount)
totalAmount = totalAmount.add(BigNumber.from(getAstraTokenAmount(message.content.amount)))
}
return formatEther(totalAmount)
}
Expand Down

0 comments on commit 7862f98

Please sign in to comment.