diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-10-23 15:19:16 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-10-23 15:19:16 -0400 |
commit | bd91b3eacfb635004a31d2e62ef501441da126f3 (patch) | |
tree | 5feb2f0fbc1cc16ed660fe5a1c0d415285b2690f | |
parent | 64b16f4a5039bee9a97d3c69db0b49c5a9217908 (diff) | |
download | alps-bd91b3eacfb635004a31d2e62ef501441da126f3.tar.gz alps-bd91b3eacfb635004a31d2e62ef501441da126f3.zip |
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.
-rw-r--r-- | themes/alps/message.html | 5 |
1 files changed, 4 insertions, 1 deletions
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 }} <div class="tabs"> - {{ 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 */}} <a href="?part={{.Message.TextPart.PathString}}" {{ if eq $text.PathString .Part.PathString }} @@ -192,6 +194,7 @@ {{ end }} >HTML</a> {{ end }} + {{ end }} </div> {{if .View}} {{.View}} |