Skip to content

Commit 8e79298

Browse files
authored
Fix a couple of issues with a feeds (go-gitea#14897) (go-gitea#14903)
Backport (go-gitea#14897) witch fix couple of issues with feeds
1 parent da80e90 commit 8e79298

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

modules/templates/helper.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,11 @@ func ActionIcon(opType models.ActionType) string {
689689
// ActionContent2Commits converts action content to push commits
690690
func ActionContent2Commits(act Actioner) *repository.PushCommits {
691691
push := repository.NewPushCommits()
692+
693+
if act == nil || act.GetContent() == "" {
694+
return push
695+
}
696+
692697
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
693698
log.Error("json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err)
694699
}

templates/user/dashboard/feeds.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
<span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
9797
{{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}}
9898
<a href="{{.GetCommentLink}}" class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</a>
99-
<p class="text light grey">{{index .GetIssueInfos 1 | RenderEmoji}}</p>
99+
{{$comment := index .GetIssueInfos 1}}
100+
{{if gt (len $comment) 0}}<p class="text light grey">{{$comment | RenderEmoji}}</p>{{end}}
100101
{{else if eq .GetOpType 11}}
101102
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
102103
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}

0 commit comments

Comments
 (0)