Skip to content

Commit 379ec13

Browse files
authored
Fix 500 error caused by notifications without an issue such as repo transfers (#25101)
1 parent 036fb78 commit 379ec13

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates/user/notification/notification_div.tmpl

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
<a class="notifications-link gt-df gt-f1 gt-fc silenced" href="{{.Link}}">
4848
<div class="notifications-top-row gt-font-13">
49-
{{.Repository.FullName}} <span class="text light-3">#{{.Issue.Index}}</span>
49+
{{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
5050
{{if eq .Status 3}}
5151
{{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}}
5252
{{end}}
@@ -62,7 +62,11 @@
6262
</div>
6363
</a>
6464
<div class="notifications-updated gt-ac gt-mr-3">
65-
{{TimeSinceUnix .Issue.UpdatedUnix $locale}}
65+
{{if .Issue}}
66+
{{TimeSinceUnix .Issue.UpdatedUnix $locale}}
67+
{{else}}
68+
{{TimeSinceUnix .UpdatedUnix $locale}}
69+
{{end}}
6670
</div>
6771
<div class="notifications-buttons gt-ac gt-je gt-gap-2 gt-px-2">
6872
{{if ne .Status 3}}

0 commit comments

Comments
 (0)