summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2022-04-20 12:43:26 +0200
committerGitHub <noreply@github.com>2022-04-20 18:43:26 +0800
commitae6a52440ac47b8d0eed5875de9d801bc68c1a4a (patch)
treef68c0c42b04165ee40acdac61e1299b8989acc1f /routers
parent409ff55a293487868cfe034151d84de4cf4b4235 (diff)
downloadgitea-ae6a52440ac47b8d0eed5875de9d801bc68c1a4a.tar.gz
gitea-ae6a52440ac47b8d0eed5875de9d801bc68c1a4a.zip
Fix panic in team repos API (#19431)
* Fix panic in team repos API * Fix pagination * fmt
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/org/team.go2
-rw-r--r--routers/web/misc/markdown.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go
index d0f1fbef74..322196b819 100644
--- a/routers/api/v1/org/team.go
+++ b/routers/api/v1/org/team.go
@@ -545,7 +545,7 @@ func GetTeamRepos(ctx *context.APIContext) {
ctx.Error(http.StatusInternalServerError, "GetTeamRepos", err)
return
}
- repos := make([]*api.Repository, len(team.Repos))
+ repos := make([]*api.Repository, len(teamRepos))
for i, repo := range teamRepos {
access, err := models.AccessLevel(ctx.Doer, repo)
if err != nil {
diff --git a/routers/web/misc/markdown.go b/routers/web/misc/markdown.go
index b37aaf10ff..0567cbb30c 100644
--- a/routers/web/misc/markdown.go
+++ b/routers/web/misc/markdown.go
@@ -16,6 +16,7 @@ import (
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/web"
+
"mvdan.cc/xurls/v2"
)