Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Warning when trying to transfer a token to an empty recipient (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
evertonfraga committed Jul 11, 2017
1 parent a0fdde0 commit ede224d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/client/templates/views/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ Template['views_send'].events({
contract = TemplateVar.getFrom('.compile-contract', 'contract'),
sendAll = TemplateVar.get('sendAll');


if(selectedAccount && !TemplateVar.get('sending')) {

// set gas down to 21 000, if its invalid data, to prevent high gas usage.
Expand Down Expand Up @@ -550,7 +550,14 @@ Template['views_send'].events({
duration: 2
});

} else {
} else { // Token transfer

if(!to)
return GlobalNotification.warning({
content: 'i18n:wallet.send.error.noReceiver',
duration: 2
});

// Change recipient and amount
to = tokenAddress;
amount = 0;
Expand Down

0 comments on commit ede224d

Please sign in to comment.