Skip to content

Commit

Permalink
Merge pull request #12 from ptrcnull/fix-oob
Browse files Browse the repository at this point in the history
fix panic on out-of-range array access
  • Loading branch information
spezifisch authored Jul 30, 2024
2 parents d212b1b + 0c47126 commit 39cc1d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion page_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (q *QueuePage) updateQueue() {

// queueData methods, used by tview to lazily render the table
func (q *queueData) GetCell(row, column int) *tview.TableCell {
if row >= len(q.playerQueue) || column >= queueDataColumns {
if row >= len(q.playerQueue) || column >= queueDataColumns || row < 0 || column < 0 {
return nil
}
song := q.playerQueue[row]
Expand Down

0 comments on commit 39cc1d6

Please sign in to comment.