diff options
author | Unknwon <u@gogs.io> | 2015-11-15 14:55:12 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-15 14:55:12 -0500 |
commit | 4d3138cd1074a29b7f68227f6a900344136cabe9 (patch) | |
tree | cb5f8f25b2167803a131c52163dd5ac8600a982b /models/access.go | |
parent | 942284648e4abf045fea5b97d3f9a3d4f4d00d77 (diff) | |
download | gitea-4d3138cd1074a29b7f68227f6a900344136cabe9.tar.gz gitea-4d3138cd1074a29b7f68227f6a900344136cabe9.zip |
fix #1953
Diffstat (limited to 'models/access.go')
-rw-r--r-- | models/access.go | 4 |
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) |