From 379ec1303013d0440dbeebf8e639f2e7844ecb18 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 6 Jun 2023 23:17:56 +0800 Subject: [PATCH] Fix 500 error caused by notifications without an issue such as repo transfers (#25101) --- templates/user/notification/notification_div.tmpl | 8 ++++++-- 1 file 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 @@
- {{.Repository.FullName}} #{{.Issue.Index}} + {{.Repository.FullName}} {{if .Issue}}#{{.Issue.Index}}{{end}} {{if eq .Status 3}} {{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}} {{end}} @@ -62,7 +62,11 @@
- {{TimeSinceUnix .Issue.UpdatedUnix $locale}} + {{if .Issue}} + {{TimeSinceUnix .Issue.UpdatedUnix $locale}} + {{else}} + {{TimeSinceUnix .UpdatedUnix $locale}} + {{end}}
{{if ne .Status 3}}