From 2df38af752c13ca02a899d6a53848c68259d3336 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 --- 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 ea311c32029..33b960375f8 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -649,6 +649,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 == "" {