1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 09:57:24 +00:00

Check if api.Result is nil before reading it in populateChat()

This commit is contained in:
Gregory Rudolph
2019-12-20 09:15:55 -05:00
parent fc48ad5c4a
commit 67fc7c6e5d

View File

@ -376,7 +376,7 @@ func populateChat() {
chat := k.NewChat(channel) chat := k.NewChat(channel)
maxX, _ := g.Size() maxX, _ := g.Size()
api, err := chat.Read(maxX / 2) api, err := chat.Read(maxX / 2)
if err != nil { if err != nil || api.Result == nil {
for _, testChan := range channels { for _, testChan := range channels {
if channel.Name == testChan.Name { if channel.Name == testChan.Name {
channel = testChan channel = testChan