Fix error handling when requesting profile image for bad user ID (#8618)

This commit is contained in:
Joram Wilander
2018-04-13 10:57:22 -04:00
committed by Christopher Speller
parent ae5e324be8
commit 21b1cd44e0
3 changed files with 9 additions and 1 deletions

View File

@@ -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]