diff options
-rw-r--r-- | api/post.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go index cbfbf49f2..4eb87349e 100644 --- a/api/post.go +++ b/api/post.go @@ -378,7 +378,13 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team return } - firstWord := strings.Split(post.Message, " ")[0] + splitWords := strings.Fields(post.Message) + + if len(splitWords) == 0 { + return + } + + firstWord := splitWords[0] relevantHooks := []*model.OutgoingWebhook{} |