diff options
author | Joram Wilander <jwawilander@gmail.com> | 2018-04-13 10:57:22 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-04-13 07:57:22 -0700 |
commit | 21b1cd44e09c41ea581ee05de46db5e5f3fa1696 (patch) | |
tree | c939c4f6de8f72d6a2b7936b097163b273088921 /api4/user.go | |
parent | ae5e324be8078927bf088bc9dae37189a6ecea6f (diff) | |
download | chat-21b1cd44e09c41ea581ee05de46db5e5f3fa1696.tar.gz chat-21b1cd44e09c41ea581ee05de46db5e5f3fa1696.tar.bz2 chat-21b1cd44e09c41ea581ee05de46db5e5f3fa1696.zip |
Fix error handling when requesting profile image for bad user ID (#8618)
Diffstat (limited to 'api4/user.go')
-rw-r--r-- | api4/user.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api4/user.go b/api4/user.go index 20b035f1d..9aa709db5 100644 --- a/api4/user.go +++ b/api4/user.go @@ -199,7 +199,8 @@ func getProfileImage(c *Context, w http.ResponseWriter, r *http.Request) { return } else { if len(users) == 0 { - c.Err = err + c.Err = model.NewAppError("getProfileImage", "api.user.get_profile_image.not_found.app_error", nil, "", http.StatusNotFound) + return } user := users[0] |