diff --git a/src/chat.rs b/src/chat.rs index 4197b4142..ffce31db3 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1743,12 +1743,12 @@ pub fn get_next_media( match direction { Direction::Forward => { if i + 1 < list.len() { - ret = Some(list[i + 1]); + ret = list.get(i + 1).copied(); } } Direction::Backward => { if i >= 1 { - ret = Some(list[i - 1]); + ret = list.get(i - 1).copied(); } } }