mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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:
parent
cb63e8efed
commit
dd6d3232fa
@ -35,7 +35,7 @@ export default class TokenCurrencyDisplay extends PureComponent {
|
|||||||
|
|
||||||
let displayValue
|
let displayValue
|
||||||
|
|
||||||
if (tokenData.params && tokenData.params.length) {
|
if (tokenData && tokenData.params && tokenData.params.length) {
|
||||||
const tokenValue = getTokenValue(tokenData.params)
|
const tokenValue = getTokenValue(tokenData.params)
|
||||||
displayValue = calcTokenAmount(tokenValue, decimals).toString()
|
displayValue = calcTokenAmount(tokenValue, decimals).toString()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user