1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Merge pull request #3741 from MetaMask/i3692-addtoken-address-undefined

Prevent users from adding custom token if decimals is an empty string.
This commit is contained in:
kumavis 2018-03-27 19:07:23 -07:00 committed by GitHub
commit c84f0ac7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')
}