Skip to content

Commit

Permalink
Throw error for no slack user tagged
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Sep 18, 2019
1 parent b78d2ff commit e873f33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/interactions/leaderAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const interactionLeaderAdd = (bot, message) => {
}

const taggedUserID = (message.text.match(/\<@(.*)\|/) || [])[1]
if (!taggedUserID) {
throw new Error('Invalid Slack user')
}

getInfoForUser(taggedUserID)
.then(taggedUser => {
Expand Down

0 comments on commit e873f33

Please sign in to comment.