Skip to content

Commit 9f6d944

Browse files
committed
Fix incorrect beahavior when dequeueing HEAD
Fix crash when trying to check if a non-existent download now exists when queue is non-zero length
1 parent 631659d commit 9f6d944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,5 @@ func DownloadAtHead(expect *data.QueueItem) bool {
193193
mut.RLock()
194194
defer mut.RUnlock()
195195

196-
return len(queue) != 0 && queue[head-1] == expect
196+
return len(queue) != 0 && head-1 >= 0 && queue[head-1] == expect
197197
}

0 commit comments

Comments
 (0)