From bd91b3eacfb635004a31d2e62ef501441da126f3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 23 Oct 2020 15:19:16 -0400 Subject: [PATCH] Fix errors arising from short-circuit assumption The and/or operators in text/template don't short-circuit, so this seemingly benign change caused a breakage when not fully tested. --- themes/alps/message.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/themes/alps/message.html b/themes/alps/message.html index c92d5ac..5d5f64b 100644 --- a/themes/alps/message.html +++ b/themes/alps/message.html @@ -178,7 +178,9 @@ {{ $html := .Message.HTMLPart }} {{ $text := .Message.TextPart }}
- {{ if and $html (ne $html.PathString $text.PathString) }} + {{ if and $html $text }} + {{ if ne $html.PathString $text.PathString }} + {{/* https://github.com/golang/go/issues/31103 */}} HTML {{ end }} + {{ end }}
{{if .View}} {{.View}}