mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Throw if send() fails in example code
This commit is contained in:
parent
56727d61a6
commit
e3a942c738
@ -542,7 +542,8 @@ shown in the following example:
|
||||
Campaign c = campaigns[campaignID];
|
||||
if (c.amount < c.fundingGoal)
|
||||
return false;
|
||||
c.beneficiary.send(c.amount);
|
||||
if (!c.beneficiary.send(c.amount))
|
||||
throw;
|
||||
c.amount = 0;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user