validate empty input in send command

Former-commit-id: 29968b2ff3
This commit is contained in:
Roman Volosovskyi 2016-09-20 17:15:29 +03:00
parent f5854fb43c
commit 38505bd2cc
1 changed files with 11 additions and 0 deletions

View File

@ -262,6 +262,17 @@ status.command({
});
function validateBalance(params) {
if(!params.value){
return {
errors: [
status.components.validationMessage(
"Amount",
"Amount must be specified"
)
]
};
}
try {
var val = web3.toWei(params.value, "ether");
} catch (err) {