Skip to content

Commit

Permalink
add more control over erroring in info.funds.get
Browse files Browse the repository at this point in the history
  • Loading branch information
jgimeno committed Feb 20, 2024
1 parent 98cad04 commit 346ae7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/core-token-vesting/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ fn create_campaign(
return Err(StdError::generic_err("one denom sent required").into());
}

let coin = info.funds.get(0)?;
let coin = info.funds.get(0).ok_or(StdError::generic_err(
"one denom sent required, unexpected error",
))?;

let campaign = Campaign {
campaign_name,
Expand Down

0 comments on commit 346ae7a

Please sign in to comment.