Skip to content

Commit

Permalink
Fix ERC20 token value decoding (#5995)
Browse files Browse the repository at this point in the history
When MetaMask user calls non-standard ERC20 methods such as `mint`, `tokenData` will be `undefined` and an uncaught error will break the UI
  • Loading branch information
Hsuan Lee authored and whymarrh committed Jan 4, 2019
1 parent cb63e8e commit dd6d323
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit dd6d323

Please sign in to comment.