aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo/repo_list.go
diff options
context:
space:
mode:
authorDhruv Manilawala <dhruvmanila@gmail.com>2022-07-22 03:01:22 +0530
committerGitHub <noreply@github.com>2022-07-21 23:31:22 +0200
commit3df33799c1b8775b4110ed11171a37f6c5ef4ae2 (patch)
tree3e1bb68fef30b0dc61385b8a2ee1fe588afc2414 /models/repo/repo_list.go
parent0a97480934fc2082c9cff18a5b66cedc12575919 (diff)
downloadgitea-3df33799c1b8775b4110ed11171a37f6c5ef4ae2.tar.gz
gitea-3df33799c1b8775b4110ed11171a37f6c5ef4ae2.zip
Fix: Actor is required to get user repositories (#20443)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/repo/repo_list.go')
-rw-r--r--models/repo/repo_list.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/repo/repo_list.go b/models/repo/repo_list.go
index a70fc8efd4..9de76fa5ff 100644
--- a/models/repo/repo_list.go
+++ b/models/repo/repo_list.go
@@ -6,6 +6,7 @@ package repo
import (
"context"
+ "errors"
"fmt"
"strings"
@@ -695,6 +696,9 @@ func GetUserRepositories(opts *SearchRepoOptions) (RepositoryList, int64, error)
}
cond := builder.NewCond()
+ if opts.Actor == nil {
+ return nil, 0, errors.New("GetUserRepositories: Actor is needed but not given")
+ }
cond = cond.And(builder.Eq{"owner_id": opts.Actor.ID})
if !opts.Private {
cond = cond.And(builder.Eq{"is_private": false})