From e9f4c2db8291c54044345aebd9381ac820ed9687 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 27 Feb 2024 23:09:13 +0800 Subject: [PATCH] Fix missed return (#29450) --- 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 907a5b568e..4895f7b1b3 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -655,6 +655,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 == "" {