Check balance before testing it w/ isZero (#6898)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent e81aa6073d
commit fc3b035aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/controllers/detect-tokens.js

@ -47,7 +47,7 @@ class DetectTokensController {
}
tokensToDetect.forEach((tokenAddress, index) => {
const balance = result[index]
if (!balance.isZero()) {
if (balance && !balance.isZero()) {
this._preferences.addToken(tokenAddress, contracts[tokenAddress].symbol, contracts[tokenAddress].decimals)
}
})

Loading…
Cancel
Save