Unfortunately go template if does not shortcut (#11392)
Go template's `{{if ...}}` does not shortcut its tests therefore it is possible to cause a NPE unless you separate ifs into two. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
aa29f1c2b9
commit
ba40263fdd
1 changed files with 4 additions and 2 deletions
|
@ -104,10 +104,12 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<i class="unlock icon"></i>
|
<i class="unlock icon"></i>
|
||||||
{{.i18n.Tr .Verification.Reason}}
|
{{.i18n.Tr .Verification.Reason}}
|
||||||
{{if and .Verification.SigningKey (ne .Verification.SigningKey.KeyID "")}}
|
{{if .Verification.SigningKey}}
|
||||||
|
{{if ne .Verification.SigningKey.KeyID ""}}
|
||||||
<span class="pull-right"><span class="ui text">{{.i18n.Tr "repo.commits.gpg_key_id"}}:</span> <i class="warning icon"></i>{{.Verification.SigningKey.KeyID}}</span>
|
<span class="pull-right"><span class="ui text">{{.i18n.Tr "repo.commits.gpg_key_id"}}:</span> <i class="warning icon"></i>{{.Verification.SigningKey.KeyID}}</span>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .Note}}
|
{{if .Note}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue