aboutsummaryrefslogtreecommitdiffstats
path: root/routers/org/teams.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/org/teams.go')
-rw-r--r--routers/org/teams.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 9aa8e50214..77a7b6e13c 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -124,6 +124,11 @@ func TeamsRepoAction(ctx *middleware.Context) {
var repo *models.Repository
repo, err = models.GetRepositoryByName(ctx.Org.Organization.Id, repoName)
if err != nil {
+ if err == models.ErrRepoNotExist {
+ ctx.Flash.Error(ctx.Tr("org.teams.add_nonexistent_repo"))
+ ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
+ return
+ }
ctx.Handle(500, "GetRepositoryByName", err)
return
}