Merge pull request #3741 from MetaMask/i3692-addtoken-address-undefined

Prevent users from adding custom token if decimals is an empty string.
feature/default_network_editable
kumavis 7 years ago committed by GitHub
commit c84f0ac7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ui/app/add-token.js

@ -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…
Cancel
Save