fix: crash when unable to fetch channel list on start
This commit is contained in:
parent
bd01006d62
commit
b6391c6802
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
|
@ -190,6 +190,11 @@ func FetchFavoritesAndChannels() {
|
|||
ctx.View.FavoriteList.Clear()
|
||||
|
||||
channels := difm.ListChannels(ctx)
|
||||
if len(channels) == 0 {
|
||||
ctx.SetStatusMessage("Unable to get the channel list.")
|
||||
return
|
||||
}
|
||||
|
||||
for _, chn := range channels {
|
||||
ctx.View.ChannelList.AddItem(chn.Name, "", 0, func() {
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue