1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

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
This commit is contained in:
Hsuan Lee 2019-01-04 20:06:25 +08:00 committed by Whymarrh Whitby
parent cb63e8efed
commit dd6d3232fa

View File

@ -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()
}