From 8906b2891ba0dc1aba2acbaee5e0051043894b2f Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Thu, 18 May 2017 14:35:06 -0300 Subject: [PATCH] Fix test There was a panic when there's no logged in user --- routers/api/v1/repo/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }