Skip to content

Commit bb9cb03

Browse files
committed
Fix index out of range
1 parent d8a4d39 commit bb9cb03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/glance/widget-videos.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ func (widget *videosWidget) initialize() error {
5252
// playlists are separate things rather than specifying a list of channels and some of
5353
// them awkwardly have a "playlist:" prefix
5454
if len(widget.Playlists) > 0 {
55+
initialLen := len(widget.Channels)
5556
widget.Channels = append(widget.Channels, make([]string, len(widget.Playlists))...)
5657

5758
for i := range widget.Playlists {
58-
widget.Channels[len(widget.Channels)-1+i] = "playlist:" + widget.Playlists[i]
59+
widget.Channels[initialLen+i] = "playlist:" + widget.Playlists[i]
5960
}
6061
}
6162

0 commit comments

Comments
 (0)