From 4f790565e7630a41e94ebd94d39e02aef1d5aa66 Mon Sep 17 00:00:00 2001 From: Zachary Tsang Date: Tue, 13 Aug 2024 12:31:03 +0800 Subject: [PATCH] fix: stop crashing when reading malformed slash command --- pkg/slack/app.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/slack/app.go b/pkg/slack/app.go index 231e795..1308c25 100644 --- a/pkg/slack/app.go +++ b/pkg/slack/app.go @@ -199,14 +199,14 @@ func (a *App) messageLoop(ctx context.Context, client *socketmode.Client) { if data.Command != "/"+a.commandName { client.Ack(*e.Request, map[string]interface{}{ "text": fmt.Sprintf("Unknown command '%s'\n", data.Command)}) - return + continue } args := strings.Split(data.Text, " ") if len(args) < 2 { client.Ack(*e.Request, map[string]interface{}{ "text": fmt.Sprintf("Please specify subcommand and repo")}) - return + continue } repo := args[1] @@ -216,7 +216,7 @@ func (a *App) messageLoop(ctx context.Context, client *socketmode.Client) { client.Ack(*e.Request, map[string]interface{}{ "text": fmt.Sprintf("Invalid repo '%s'\n", repo), }) - return + continue } switch subcommand {