Skip to content

Commit a308b36

Browse files
committed
refactor: handle potential None case when retrieving milestone updates in validate_milestone_status_change_conditions
1 parent d606c9f commit a308b36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

contracts/escrow/src/core/validators/milestone.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ pub fn validate_milestone_status_change_conditions(
2020
}
2121

2222
for i in 0..milestone_updates.len() {
23-
let update = milestone_updates.get(i).unwrap();
23+
let update = milestone_updates
24+
.get(i)
25+
.ok_or(ContractError::MilestoneToUpdateDoesNotExist)?;
2426

2527
if update.status.is_empty() {
2628
return Err(ContractError::EmptyMilestoneStatus);

0 commit comments

Comments
 (0)