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:
commit
c84f0ac7bc
|
@ -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')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue