From 92eb16fc112eeac749c0ddfff163773ce3a35ef2 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 27 Dec 2017 17:36:56 -0800 Subject: Add frontend validation to check if send ether input is a valid number. --- ui/app/send.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui/app/send.js') diff --git a/ui/app/send.js b/ui/app/send.js index e59c1130e..7b31eef7e 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -247,6 +247,12 @@ SendTransactionScreen.prototype.onSubmit = function () { const recipient = state.recipient || document.querySelector('input[name="address"]').value.replace(/^[.\s]+|[.\s]+$/g, '') const nickname = state.nickname || ' ' const input = document.querySelector('input[name="amount"]').value + + if (isNaN(input)) { + message = 'Invalid ether value.' + return this.props.dispatch(actions.displayWarning(message)) + } + const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value const balance = this.props.balance -- cgit