Fix bug that allow index out of bounds on next

This commit is contained in:
Hans Mündelein 2023-06-04 08:41:00 +02:00
parent af63d50dc5
commit e926b63140
Signed by: hans
GPG Key ID: BA7B55E984CE74F4
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ impl Queue {
}
pub fn next_track(&mut self) -> Option<Track> {
if self.current_position < self.tracks.len() as u32 {
if self.current_position < self.tracks.len() as u32 - 1 {
self.current_position += 1;
Some(self.tracks[self.current_position as usize].clone())
} else {