summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2017-05-18 14:35:06 -0300
committerAndrey Nering <andrey.nering@gmail.com>2017-05-18 14:35:06 -0300
commit8906b2891ba0dc1aba2acbaee5e0051043894b2f (patch)
treeb68c8ccfe3c94dbc188f5e657205c238dfea2ad6 /routers
parentdc2b28ed769c234def22050e5f2a487b60c697af (diff)
downloadgitea-8906b2891ba0dc1aba2acbaee5e0051043894b2f.tar.gz
gitea-8906b2891ba0dc1aba2acbaee5e0051043894b2f.zip
Fix test
There was a panic when there's no logged in user
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index c299b969bc..66e430548b 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -33,7 +33,7 @@ func Search(ctx *context.APIContext) {
OwnerID: ctx.QueryInt64("uid"),
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
}
- if ctx.User.ID == opts.OwnerID {
+ if ctx.User != nil && ctx.User.ID == opts.OwnerID {
opts.Searcher = ctx.User
}