aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-03-28 10:07:23 +0800
committerGitHub <noreply@github.com>2018-03-28 10:07:23 +0800
commitc84f0ac7bcfe8b011e26668a262bdb83badc8619 (patch)
treeb63bb8451b06902d6f3957495ba01989c6981fd1 /ui/app
parent5a1f9d525dfcbf13cd66789f8a670228e3c7ea41 (diff)
parent91f91d92fe2798789c26739af818e8f18a2547fb (diff)
downloadtangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar.gz
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar.bz2
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar.lz
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar.xz
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.tar.zst
tangerine-wallet-browser-c84f0ac7bcfe8b011e26668a262bdb83badc8619.zip
Merge pull request #3741 from MetaMask/i3692-addtoken-address-undefined
Prevent users from adding custom token if decimals is an empty string.
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/add-token.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/app/add-token.js b/ui/app/add-token.js
index a96871853..472f3b736 100644
--- a/ui/app/add-token.js
+++ b/ui/app/add-token.js
@@ -142,7 +142,10 @@ AddTokenScreen.prototype.validate = function () {
errors.customAddress = this.props.t('invalidAddress')
}
- const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36
+ const validDecimals = customDecimals !== null
+ && customDecimals !== ''
+ && customDecimals >= 0
+ && customDecimals < 36
if (!validDecimals) {
errors.customDecimals = this.props.t('decimalsMustZerotoTen')
}