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.
This commit is contained in:
parent
64b16f4a50
commit
bd91b3eacf
1 changed files with 4 additions and 1 deletions
|
@ -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}}
|
||||
|
|
Loading…
Reference in a new issue