summaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-15 14:55:12 -0500
committerUnknwon <u@gogs.io>2015-11-15 14:55:12 -0500
commit4d3138cd1074a29b7f68227f6a900344136cabe9 (patch)
treecb5f8f25b2167803a131c52163dd5ac8600a982b /models/access.go
parent942284648e4abf045fea5b97d3f9a3d4f4d00d77 (diff)
downloadgitea-4d3138cd1074a29b7f68227f6a900344136cabe9.tar.gz
gitea-4d3138cd1074a29b7f68227f6a900344136cabe9.zip
fix #1953
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)