aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortechknowlogick2021-08-06 04:09:33 -0400
committerGitHub2021-08-06 11:09:33 +0300
commit20601f84639543e19fdcbdf61f5a1a37c20890e5 (patch)
treea2ed1a4232c825ddaf3639043fa2e6518494d514
parent619e6d6400bb9794cf9c545fe18f7cb0e8ce5db7 (diff)
Prevent 500 on draft releases without tag (#16634) (#16636)
It is possible to create draft releases prior to creating a tag. This will cause a 500 on the releases page due to compare page failing. This PR only shows the compare button if there is a SHA1 present. Fix #16610 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
-rw-r--r--templates/repo/release/list.tmpl4
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index f9bc0ebb0..5f06bf45d 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -82,7 +82,9 @@
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
</span>
{{end}}
- {{template "repo/branch_dropdown" dict "root" $ "release" .}}
+ {{if .Sha1 }}
+ {{template "repo/branch_dropdown" dict "root" $ "release" .}}
+ {{end}}
{{end}}
</div>
<div class="ui twelve wide column detail">