1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

#1369: nil pointer when add repo to team

This commit is contained in:
Unknwon 2015-07-24 16:52:01 +08:00
parent 548b95f7b5
commit 04e596f984

View file

@ -173,13 +173,12 @@ func (repo *Repository) refreshCollaboratorAccesses(e Engine, accessMap map[int6
func (repo *Repository) recalculateTeamAccesses(e Engine, ignTeamID int64) (err error) { func (repo *Repository) recalculateTeamAccesses(e Engine, ignTeamID int64) (err error) {
accessMap := make(map[int64]AccessMode, 20) accessMap := make(map[int64]AccessMode, 20)
if err = repo.refreshCollaboratorAccesses(e, accessMap); err != nil {
return fmt.Errorf("refreshCollaboratorAccesses: %v", err)
}
if err = repo.getOwner(e); err != nil { if err = repo.getOwner(e); err != nil {
return err return err
} }
if err = repo.refreshCollaboratorAccesses(e, accessMap); err != nil {
return fmt.Errorf("refreshCollaboratorAccesses: %v", err)
}
if repo.Owner.IsOrganization() { if repo.Owner.IsOrganization() {
if err = repo.Owner.getTeams(e); err != nil { if err = repo.Owner.getTeams(e); err != nil {
return err return err