There was a panic when there's no logged in user
pull/1750/head
Andrey Nering 7 years ago
parent dc2b28ed76
commit 8906b2891b
  1. 2
      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
}

Loading…
Cancel
Save