Fix panic on next on empty queue
CI checks / stable / fmt (push) Successful in 3s Details

This commit is contained in:
Hans Mündelein 2023-06-14 10:51:29 +02:00
parent dfd2e0af92
commit 97ebb44ca5
Signed by: hans
GPG Key ID: BA7B55E984CE74F4
1 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,9 @@ impl QueueManager {
pub fn next_track(&mut self) -> Option<Track> {
let len = self.tracks.len();
if len == 0 {
return None;
};
if self.current_offset < len - 1 {
self.current_offset += 1;
let current_pos = self.current_position();