Skip to content

Commit 8906b28

Browse files
committed
Fix test
There was a panic when there's no logged in user
1 parent dc2b28e commit 8906b28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Search(ctx *context.APIContext) {
3333
OwnerID: ctx.QueryInt64("uid"),
3434
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
3535
}
36-
if ctx.User.ID == opts.OwnerID {
36+
if ctx.User != nil && ctx.User.ID == opts.OwnerID {
3737
opts.Searcher = ctx.User
3838
}
3939

0 commit comments

Comments
 (0)