From 346ae7a0ef784ab687bdaffeac634ed1091f36b2 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 20 Feb 2024 16:18:26 +0100 Subject: [PATCH] add more control over erroring in info.funds.get --- contracts/core-token-vesting/src/contract.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/core-token-vesting/src/contract.rs b/contracts/core-token-vesting/src/contract.rs index 6245454..b6d7b3c 100644 --- a/contracts/core-token-vesting/src/contract.rs +++ b/contracts/core-token-vesting/src/contract.rs @@ -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,