summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
Diffstat (limited to 'api4')
-rw-r--r--api4/user.go3
-rw-r--r--api4/user_test.go3
2 files changed, 5 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]
diff --git a/api4/user_test.go b/api4/user_test.go
index 359756aeb..27219726b 100644
--- a/api4/user_test.go
+++ b/api4/user_test.go
@@ -834,6 +834,9 @@ func TestGetProfileImage(t *testing.T) {
_, resp = Client.GetProfileImage("junk", "")
CheckBadRequestStatus(t, resp)
+ _, resp = Client.GetProfileImage(model.NewId(), "")
+ CheckNotFoundStatus(t, resp)
+
Client.Logout()
_, resp = Client.GetProfileImage(user.Id, "")
CheckUnauthorizedStatus(t, resp)