From 4b3ddf876997b9492e8a7264b762bd9f9699a0a3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 22 Mar 2020 16:41:15 -0700 Subject: [PATCH] fix: Account for no text param passed to hooks.slack This will never happen in production, Slack always provides the param but prevents a possible 500 server error when messing with the API manually. --- server/api/hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/hooks.js b/server/api/hooks.js index f82f22ecd..4b7612648 100644 --- a/server/api/hooks.js +++ b/server/api/hooks.js @@ -99,7 +99,7 @@ router.post('hooks.interactive', async ctx => { // triggered by the /outline command in Slack router.post('hooks.slack', async ctx => { - const { token, team_id, user_id, text } = ctx.body; + const { token, team_id, user_id, text = "" } = ctx.body; ctx.assertPresent(token, 'token is required'); ctx.assertPresent(team_id, 'team_id is required'); ctx.assertPresent(user_id, 'user_id is required');