summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/user.go
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-05-08 15:17:32 -0400
committerLauris BH <lauris@nix.lv>2019-05-08 22:17:32 +0300
commit6db3dc7c021e05658f063e577e2ea972b8bad80d (patch)
tree9f8bd8115bc21dd823601bd2c430a1069590b06c /routers/api/v1/user/user.go
parentd8b2ed6627d60d3573ba4864e72601230e1d0eaf (diff)
downloadgitea-6db3dc7c021e05658f063e577e2ea972b8bad80d.tar.gz
gitea-6db3dc7c021e05658f063e577e2ea972b8bad80d.zip
Fixes #6881 - API users search fix (#6882)
Diffstat (limited to 'routers/api/v1/user/user.go')
-rw-r--r--routers/api/v1/user/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index 2e4ae273e5..76b4fc8dcc 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -67,7 +67,7 @@ func Search(ctx *context.APIContext) {
results := make([]*api.User, len(users))
for i := range users {
- results[i] = convert.ToUser(users[i], ctx.IsSigned, ctx.User.IsAdmin)
+ results[i] = convert.ToUser(users[i], ctx.IsSigned, ctx.User != nil && ctx.User.IsAdmin)
}
ctx.JSON(200, map[string]interface{}{