From d07156402bca8db528382448fb9a756a2417ece1 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 17 Oct 2019 13:21:00 -0400 Subject: [PATCH] Bugfix: Input crashes kbtui #13 --- cmdReply.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmdReply.go b/cmdReply.go index aa2c231..457daf1 100644 --- a/cmdReply.go +++ b/cmdReply.go @@ -21,13 +21,19 @@ func init() { func cmdReply(cmd []string) { chat := k.NewChat(channel) + if len(cmd) < 2 { + printToView("Feed", fmt.Sprintf("%sreply $ID - Reply to message $ID", cmdPrefix)) + return + } messageID, err := strconv.Atoi(cmd[1]) if err != nil { printToView("Feed", fmt.Sprintf("There was an error determining message ID %s", cmd[1])) + return } _, err = chat.Reply(messageID, strings.Join(cmd[2:], " ")) if err != nil { printToView("Feed", "There was an error with your reply.") + return } return }