diff --git a/app/webhook.go b/app/webhook.go index 857d1607bfa6e..a9bb32f3574db 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -113,7 +113,7 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model. webhookResp := model.OutgoingWebhookResponseFromJson(resp.Body) - if webhookResp != nil && webhookResp.Text != nil { + if webhookResp != nil && (webhookResp.Text != nil || len(webhookResp.Attachments) > 0) { postRootId := "" if webhookResp.ResponseType == model.OUTGOING_HOOK_RESPONSE_TYPE_COMMENT { postRootId = post.Id @@ -123,7 +123,10 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model. } webhookResp.Props["webhook_display_name"] = hook.DisplayName - text := a.ProcessSlackText(*webhookResp.Text) + text := "" + if webhookResp.Text != nil { + text = a.ProcessSlackText(*webhookResp.Text) + } webhookResp.Attachments = a.ProcessSlackAttachments(webhookResp.Attachments) // attachments is in here for slack compatibility if len(webhookResp.Attachments) > 0 {