mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Prevent users from adding custom token if decimals is an empty string.
This commit is contained in:
parent
dac66b8ee9
commit
91f91d92fe
@ -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')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user