Skip to content

Commit dc35d46

Browse files
committed
fix errors in conversion
1 parent 87f320c commit dc35d46

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/frontend/account/AccountDetail/useAccountDetailHook.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ export const useAccountDetailHook = ({ id, txType }: detailProps): AccountDetail
8383
(accounts && accounts.length > 0 && accounts[0].accountId)
8484
) {
8585
const { tokens } = await getToken()
86-
if (tokens.length > 0) {
86+
if (tokens && tokens.length > 0) {
8787
tokens.forEach(
88-
(item: { contractType: ContractType; contractInfo: { decimals: string }; balance: BigNumberish }) => {
88+
(item: { contractType: ContractType; contractInfo: { decimals: string } | null; balance: BigNumberish }) => {
8989
if (item.contractType === ContractType.ERC_20) {
90-
const decimalsValue = item.contractInfo.decimals ? parseInt(item.contractInfo.decimals) : 18
90+
const decimalsValue = item.contractInfo?.decimals ? parseInt(item.contractInfo.decimals) : 18
9191
item.balance = utils.formatUnits(item.balance, decimalsValue)
9292
}
9393
}

0 commit comments

Comments
 (0)