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:
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
Block a user