Skip to content

Commit d768a44

Browse files
committed
fix check
1 parent 7b69535 commit d768a44

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

routers/web/repo/release.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ func NewReleasePost(ctx *context.Context) {
361361
return
362362
}
363363

364+
// Title of release cannot be empty
365+
if len(form.TagOnly) == 0 && len(form.Title) == 0 {
366+
ctx.RenderWithErr(ctx.Tr("repo.release.title_empty"), tplReleaseNew, &form)
367+
return
368+
}
369+
364370
var attachmentUUIDs []string
365371
if setting.Attachment.Enabled {
366372
attachmentUUIDs = form.Files
@@ -408,12 +414,6 @@ func NewReleasePost(ctx *context.Context) {
408414
return
409415
}
410416

411-
// Title of release cannot be empty
412-
if len(form.Title) == 0 {
413-
ctx.RenderWithErr(ctx.Tr("repo.release.title_empty"), tplReleaseNew, &form)
414-
return
415-
}
416-
417417
rel = &repo_model.Release{
418418
RepoID: ctx.Repo.Repository.ID,
419419
Repo: ctx.Repo.Repository,

0 commit comments

Comments
 (0)