mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #764 from Denton-L/make-safe
Throw if send() fails in example code
This commit is contained in:
commit
267b32df83
@ -545,7 +545,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