summaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/access.go')
-rw-r--r--models/access.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/access.go b/models/access.go
index 9e8c2dfe69..8a7729b734 100644
--- a/models/access.go
+++ b/models/access.go
@@ -101,6 +101,10 @@ func (u *User) GetAccessibleRepositories() ([]*Repository, error) {
return nil, err
}
+ if len(accesses) == 0 {
+ return []*Repository{}, nil
+ }
+
repoIDs := make([]int64, 0, len(accesses))
for _, access := range accesses {
repoIDs = append(repoIDs, access.RepoID)