Fix ERC20 token value decoding (#5995)

When MetaMask user calls non-standard ERC20 methods such as `mint`, `tokenData` will be `undefined` and an uncaught error will break the UI
feature/default_network_editable
Hsuan Lee 6 years ago committed by Whymarrh Whitby
parent cb63e8efed
commit dd6d3232fa
  1. 2
      ui/app/components/token-currency-display/token-currency-display.component.js

@ -35,7 +35,7 @@ export default class TokenCurrencyDisplay extends PureComponent {
let displayValue
if (tokenData.params && tokenData.params.length) {
if (tokenData && tokenData.params && tokenData.params.length) {
const tokenValue = getTokenValue(tokenData.params)
displayValue = calcTokenAmount(tokenValue, decimals).toString()
}

Loading…
Cancel
Save