mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Fix index out of range
This commit is contained in:
parent
d8a4d39849
commit
bb9cb03c8a
@ -52,10 +52,11 @@ func (widget *videosWidget) initialize() error {
|
|||||||
// playlists are separate things rather than specifying a list of channels and some of
|
// playlists are separate things rather than specifying a list of channels and some of
|
||||||
// them awkwardly have a "playlist:" prefix
|
// them awkwardly have a "playlist:" prefix
|
||||||
if len(widget.Playlists) > 0 {
|
if len(widget.Playlists) > 0 {
|
||||||
|
initialLen := len(widget.Channels)
|
||||||
widget.Channels = append(widget.Channels, make([]string, len(widget.Playlists))...)
|
widget.Channels = append(widget.Channels, make([]string, len(widget.Playlists))...)
|
||||||
|
|
||||||
for i := range 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]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user