mirror of
https://github.com/gogs/gogs.git
synced 2026-01-30 19:19:18 +01:00
explore: panic if search without login (#3088)
This commit is contained in:
@@ -75,9 +75,13 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
|
||||
}
|
||||
count = opts.Counter(opts.Private)
|
||||
} else {
|
||||
var ctxUserID int64
|
||||
if ctx.IsSigned {
|
||||
ctxUserID = ctx.User.ID
|
||||
}
|
||||
repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
|
||||
Keyword: keyword,
|
||||
UserID: ctx.User.ID,
|
||||
UserID: ctxUserID,
|
||||
OrderBy: opts.OrderBy,
|
||||
Private: opts.Private,
|
||||
Page: page,
|
||||
|
||||
Reference in New Issue
Block a user