From d97cd15a1b4b53b285521f90ca6d131c421f28ed Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 27 Feb 2024 23:33:03 +0800 Subject: [PATCH] Fix missed return (#29450) (#29453) Backport #29450 by @lunny Co-authored-by: Lunny Xiao (cherry picked from commit 2df38af752c13ca02a899d6a53848c68259d3336) --- routers/api/v1/repo/file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 9ee10f6ce1..810dbe97f1 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -654,6 +654,7 @@ func UpdateFile(ctx *context.APIContext) { apiOpts := web.GetForm(ctx).(*api.UpdateFileOptions) if ctx.Repo.Repository.IsEmpty { ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty")) + return } if apiOpts.BranchName == "" {