Skip to content

Commit c8bc77f

Browse files
lunnyGiteaBot
authored andcommitted
Add missed return after ctx.ServerError (go-gitea#31130)
1 parent d6ae2b3 commit c8bc77f

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

routers/api/v1/repo/mirror.go

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ func CreatePushMirror(ctx *context.APIContext, mirrorOption *api.CreatePushMirro
383383
if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil {
384384
if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil {
385385
ctx.ServerError("DeletePushMirrors", err)
386+
return
386387
}
387388
ctx.ServerError("AddPushMirrorRemote", err)
388389
return

routers/web/admin/repos.go

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func UnadoptedRepos(ctx *context.Context) {
9595
repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx, q, &opts)
9696
if err != nil {
9797
ctx.ServerError("ListUnadoptedRepositories", err)
98+
return
9899
}
99100
ctx.Data["Dirs"] = repoNames
100101
pager := context.NewPagination(count, opts.PageSize, opts.Page, 5)

routers/web/auth/auth.go

+1
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ func ActivateEmail(ctx *context.Context) {
831831
if email := user_model.VerifyActiveEmailCode(ctx, code, emailStr); email != nil {
832832
if err := user_model.ActivateEmail(ctx, email); err != nil {
833833
ctx.ServerError("ActivateEmail", err)
834+
return
834835
}
835836

836837
log.Trace("Email activated: %s", email.Email)

routers/web/org/projects.go

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ func MoveIssues(ctx *context.Context) {
571571
form := &movedIssuesForm{}
572572
if err = json.NewDecoder(ctx.Req.Body).Decode(&form); err != nil {
573573
ctx.ServerError("DecodeMovedIssuesForm", err)
574+
return
574575
}
575576

576577
issueIDs := make([]int64, 0, len(form.Issues))

routers/web/repo/editor.go

+1
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ func DeleteFilePost(ctx *context.Context) {
562562
} else {
563563
ctx.ServerError("DeleteRepoFile", err)
564564
}
565+
return
565566
}
566567

567568
ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath))

0 commit comments

Comments
 (0)