Commit fbd8fd88 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'zj-slack-404-error' into 'master'

Fix format of Slack when result is nil

Closes #25954

See merge request !8248
parents f3a5409c 4b7395e0
...@@ -16,7 +16,7 @@ class SlackSlashCommandsService < ChatSlashCommandsService ...@@ -16,7 +16,7 @@ class SlackSlashCommandsService < ChatSlashCommandsService
def trigger(params) def trigger(params)
# Format messages to be Slack-compatible # Format messages to be Slack-compatible
super.tap do |result| super.tap do |result|
result[:text] = format(result[:text]) result[:text] = format(result[:text]) if result.is_a?(Hash)
end end
end end
......
...@@ -18,7 +18,8 @@ describe SlackSlashCommandsService, :models do ...@@ -18,7 +18,8 @@ describe SlackSlashCommandsService, :models do
let(:service) do let(:service) do
project.create_slack_slash_commands_service( project.create_slack_slash_commands_service(
properties: { token: 'token' } properties: { token: 'token' },
active: true
) )
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment