fix: crash when unable to fetch channel list on start

This commit is contained in:
Adriano Caloiaro 2024-06-02 10:56:03 -07:00
parent bd01006d62
commit b6391c6802
No known key found for this signature in database
GPG key ID: C2BC56DE73CE3F75

View file

@ -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() {
})