Skip to content

Commit

Permalink
Fix unhandled exception when checking whether address is SC (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito authored May 5, 2022
1 parent 3223084 commit 536585d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/custom/hooks/useWalletInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ async function checkIsSmartContractWallet(
return false
}

const code = await web3.getCode(address)
return code !== '0x'
try {
const code = await web3.getCode(address)
return code !== '0x'
} catch (e) {
console.debug(`checkIsSmartContractWallet: failed to check address ${address}`, e.message)
return false
}
}

function checkIsSupportedWallet(params: {
Expand Down

0 comments on commit 536585d

Please sign in to comment.