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

Prevent user to transfer token to empty recipient #346

Merged
merged 1 commit into from
Mar 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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