diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-08-01 16:55:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 16:55:18 +0200 |
commit | d81a61398d01d839e70e2345da787e7ef89c0832 (patch) | |
tree | a0702c7874ae31b487bb0b87dcce613edc1e53b9 /api4/command.go | |
parent | 1f168263a2ff73ddee1193cccdeea533f6d501fe (diff) | |
download | chat-d81a61398d01d839e70e2345da787e7ef89c0832.tar.gz chat-d81a61398d01d839e70e2345da787e7ef89c0832.tar.bz2 chat-d81a61398d01d839e70e2345da787e7ef89c0832.zip |
Migrate all the api4 to handle errors in idiomatic way (#9143)
Diffstat (limited to 'api4/command.go')
-rw-r--r-- | api4/command.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api4/command.go b/api4/command.go index 69efee010..f7b5b702f 100644 --- a/api4/command.go +++ b/api4/command.go @@ -202,7 +202,9 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { if err != nil { c.Err = err return - } else if channel.Type != model.CHANNEL_DIRECT && channel.Type != model.CHANNEL_GROUP { + } + + if channel.Type != model.CHANNEL_DIRECT && channel.Type != model.CHANNEL_GROUP { // if this isn't a DM or GM, the team id is implicitly taken from the channel so that slash commands created on // some other team can't be run against this one commandArgs.TeamId = channel.TeamId |