From ccb26f2b879f8314324a2f1738200d0233fabed2 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Fri, 4 Oct 2019 07:44:56 -0400 Subject: [PATCH] Fix issue where opening NEW chats with some users causes crashing --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 16c3246..46659b8 100644 --- a/main.go +++ b/main.go @@ -66,7 +66,9 @@ func populateChat() { } var printMe []string var actuallyPrintMe string - lastMessage.ID = api.Result.Messages[0].Msg.ID + if len(api.Result.Messages) > 0 { + lastMessage.ID = api.Result.Messages[0].Msg.ID + } for _, message := range api.Result.Messages { if message.Msg.Content.Type == "text" { if lastMessage.ID < 1 {