diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 2e5720746..372cc4fb9 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -104,8 +104,10 @@
{{else}}
{{.i18n.Tr .Verification.Reason}}
- {{if and .Verification.SigningKey (ne .Verification.SigningKey.KeyID "")}}
- {{.i18n.Tr "repo.commits.gpg_key_id"}}: {{.Verification.SigningKey.KeyID}}
+ {{if .Verification.SigningKey}}
+ {{if ne .Verification.SigningKey.KeyID ""}}
+ {{.i18n.Tr "repo.commits.gpg_key_id"}}: {{.Verification.SigningKey.KeyID}}
+ {{end}}
{{end}}
{{end}}