mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	fix panic when get user repos from api (#1110)
This commit is contained in:
		@@ -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)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user