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
1 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,10 @@ AddTokenScreen.prototype.validate = function () {
errors.customAddress = t('invalidAddress') errors.customAddress = t('invalidAddress')
} }
const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36 const validDecimals = customDecimals !== null
&& customDecimals !== ''
&& customDecimals >= 0
&& customDecimals < 36
if (!validDecimals) { if (!validDecimals) {
errors.customDecimals = t('decimalsMustZerotoTen') errors.customDecimals = t('decimalsMustZerotoTen')
} }