From dac457df11ddd4b94e644fe27aab0327e238d5bc Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Fri, 4 Jan 2019 14:37:58 +0800 Subject: [PATCH] Fix ERC20 token value decoding When MetaMask user calls non-standard ERC20 methods such as `mint`, `tokenData` will be `undefined` Uncaught error will break the UI --- .../token-currency-display/token-currency-display.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/token-currency-display/token-currency-display.component.js b/ui/app/components/token-currency-display/token-currency-display.component.js index 6e9a6530041e..f49846449aad 100644 --- a/ui/app/components/token-currency-display/token-currency-display.component.js +++ b/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() }