mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
refactor: address panics due to indexing and slicing (#3233)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -417,7 +417,10 @@ impl GenContext {
|
||||
.position(|v| *v == node_id)
|
||||
.ok_or_else(|| "Error deciding cycle order".to_string())?;
|
||||
|
||||
let cycle_order = order[position..].to_vec();
|
||||
let cycle_order = order
|
||||
.get(position..)
|
||||
.ok_or_else(|| "Error getting cycle order".to_string())?
|
||||
.to_vec();
|
||||
Ok(Some(cycle_order))
|
||||
} else if visited.contains(&node_id) {
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user