summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-04-27 10:53:38 +0100
committerGeorge Goldberg <george@gberg.me>2018-04-27 10:53:38 +0100
commit2386acb3ddabd8827e21b1862c338a8b13a25de6 (patch)
treed9c5800bf168db532124db3c213c2607402894c6 /app
parent7294644e9d74ca1512a730c597d61a97ccbcf10c (diff)
parent7abd6176e99d3f82711af51f8d75b3142ab73758 (diff)
downloadchat-2386acb3ddabd8827e21b1862c338a8b13a25de6.tar.gz
chat-2386acb3ddabd8827e21b1862c338a8b13a25de6.tar.bz2
chat-2386acb3ddabd8827e21b1862c338a8b13a25de6.zip
Merge branch 'master' into advanced-permissions-phase-2
Diffstat (limited to 'app')
-rw-r--r--app/command.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/command.go b/app/command.go
index fa9b38bf3..039952cf0 100644
--- a/app/command.go
+++ b/app/command.go
@@ -246,8 +246,9 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
return nil, model.NewAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error(), http.StatusInternalServerError)
} else {
if resp.StatusCode == http.StatusOK {
- response := model.CommandResponseFromHTTPBody(resp.Header.Get("Content-Type"), resp.Body)
- if response == nil {
+ if response, err := model.CommandResponseFromHTTPBody(resp.Header.Get("Content-Type"), resp.Body); err != nil {
+ return nil, model.NewAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error(), http.StatusInternalServerError)
+ } else if response == nil {
return nil, model.NewAppError("command", "api.command.execute_command.failed_empty.app_error", map[string]interface{}{"Trigger": trigger}, "", http.StatusInternalServerError)
} else {
return a.HandleCommandResponse(cmd, args, response, false)