aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2023-06-06 23:17:56 +0800
committerGitHub <noreply@github.com>2023-06-06 23:17:56 +0800
commit379ec1303013d0440dbeebf8e639f2e7844ecb18 (patch)
tree51a1c5fcfb86d40cf803ca36b9a645f69b1c961e /templates
parent036fb7861fb8fb12f1dcabbd8edab9b322b7c96c (diff)
downloadgitea-379ec1303013d0440dbeebf8e639f2e7844ecb18.tar.gz
gitea-379ec1303013d0440dbeebf8e639f2e7844ecb18.zip
Fix 500 error caused by notifications without an issue such as repo transfers (#25101)
Diffstat (limited to 'templates')
-rw-r--r--templates/user/notification/notification_div.tmpl8
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 98c3b1a42e..7d50ce6071 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -46,7 +46,7 @@
</div>
<a class="notifications-link gt-df gt-f1 gt-fc silenced" href="{{.Link}}">
<div class="notifications-top-row gt-font-13">
- {{.Repository.FullName}} <span class="text light-3">#{{.Issue.Index}}</span>
+ {{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
{{if eq .Status 3}}
{{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}}
{{end}}
@@ -62,7 +62,11 @@
</div>
</a>
<div class="notifications-updated gt-ac gt-mr-3">
- {{TimeSinceUnix .Issue.UpdatedUnix $locale}}
+ {{if .Issue}}
+ {{TimeSinceUnix .Issue.UpdatedUnix $locale}}
+ {{else}}
+ {{TimeSinceUnix .UpdatedUnix $locale}}
+ {{end}}
</div>
<div class="notifications-buttons gt-ac gt-je gt-gap-2 gt-px-2">
{{if ne .Status 3}}