Browse Source

fix panic when get user repos from api (#1110)

tags/v1.1.0
Lunny Xiao 7 years ago
parent
commit
c1d5983d3e
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      routers/api/v1/user/repo.go

+ 2
- 2
routers/api/v1/user/repo.go View File

@@ -25,8 +25,8 @@ func listUserRepos(ctx *context.APIContext, u *models.User) {
apiRepos[i] = ownRepos[i].APIFormat(models.AccessModeOwner)
}
// Set repositories user has access to.
for i := len(ownRepos); i < len(apiRepos); i++ {
apiRepos[i] = accessibleRepos[i]
for i := 0; i < len(accessibleRepos); i++ {
apiRepos[i+len(ownRepos)] = accessibleRepos[i]
}
ctx.JSON(200, &apiRepos)
}

Loading…
Cancel
Save