mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-02 12:53:24 +00:00
Catch the TypeError which occours when contractCode is undefined (#2314)
This commit is contained in:
parent
08953e36c0
commit
24069ca5bf
@ -62,7 +62,7 @@ const isHardwareWallet = (walletName: string) =>
|
||||
const isSmartContractWallet = async (web3Provider: Web3, account: string): Promise<boolean> => {
|
||||
const contractCode = await web3Provider.eth.getCode(account)
|
||||
|
||||
return contractCode.replace(EMPTY_DATA, '').replace(/0/g, '') !== ''
|
||||
return !!contractCode && contractCode.replace(EMPTY_DATA, '').replace(/0/g, '') !== ''
|
||||
}
|
||||
|
||||
export const getProviderInfo = async (web3Instance: Web3, providerName = 'Wallet'): Promise<ProviderProps> => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user