1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Prevent users from adding custom token if decimals is an empty string.

This commit is contained in:
Dan 2018-03-27 03:11:55 -02:30
parent dac66b8ee9
commit 91f91d92fe

View File

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