diff options
author | Dan <danjm.com@gmail.com> | 2018-03-27 13:41:55 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-27 13:41:55 +0800 |
commit | 91f91d92fe2798789c26739af818e8f18a2547fb (patch) | |
tree | 7aa22948527f9f81ff8e155055f0a3b1b9528a97 | |
parent | dac66b8ee90d5fc1d1736729d9a30b2d0bd04ca9 (diff) | |
download | tangerine-wallet-browser-91f91d92fe2798789c26739af818e8f18a2547fb.tar.gz tangerine-wallet-browser-91f91d92fe2798789c26739af818e8f18a2547fb.tar.zst tangerine-wallet-browser-91f91d92fe2798789c26739af818e8f18a2547fb.zip |
Prevent users from adding custom token if decimals is an empty string.
-rw-r--r-- | ui/app/add-token.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/app/add-token.js b/ui/app/add-token.js index b4ea4a532..22d5cbc43 100644 --- a/ui/app/add-token.js +++ b/ui/app/add-token.js @@ -143,7 +143,10 @@ AddTokenScreen.prototype.validate = function () { errors.customAddress = t('invalidAddress') } - const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36 + const validDecimals = customDecimals !== null + && customDecimals !== '' + && customDecimals >= 0 + && customDecimals < 36 if (!validDecimals) { errors.customDecimals = t('decimalsMustZerotoTen') } |