Skip to content

Commit

Permalink
Fix index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
svilenmarkov committed Feb 10, 2025
1 parent d8a4d39 commit bb9cb03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/glance/widget-videos.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ func (widget *videosWidget) initialize() error {
// playlists are separate things rather than specifying a list of channels and some of
// them awkwardly have a "playlist:" prefix
if len(widget.Playlists) > 0 {
initialLen := len(widget.Channels)
widget.Channels = append(widget.Channels, make([]string, len(widget.Playlists))...)

for i := range widget.Playlists {
widget.Channels[len(widget.Channels)-1+i] = "playlist:" + widget.Playlists[i]
widget.Channels[initialLen+i] = "playlist:" + widget.Playlists[i]
}
}

Expand Down

0 comments on commit bb9cb03

Please sign in to comment.