From 20601f84639543e19fdcbdf61f5a1a37c20890e5 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 6 Aug 2021 04:09:33 -0400 Subject: [PATCH] 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 Co-authored-by: Lauris BH Co-authored-by: techknowlogick Co-authored-by: zeripath Co-authored-by: Lauris BH --- templates/repo/release/list.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index f9bc0ebb02..5f06bf45d4 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -82,7 +82,9 @@ {{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}} {{end}} - {{template "repo/branch_dropdown" dict "root" $ "release" .}} + {{if .Sha1 }} + {{template "repo/branch_dropdown" dict "root" $ "release" .}} + {{end}} {{end}}