aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--routers/home.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/home.go b/routers/home.go
index 63a56490..3c1aa6d5 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -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,