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:
parent
cb63e8efed
commit
dd6d3232fa
@ -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…
Reference in New Issue
Block a user