From 20f13bfdfc5f801e6db319d8d87da0ee139aa32e Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 6 Mar 2021 04:09:49 +0000 Subject: Fix a couple of issues with a feeds (#14897) @CirnoT spotted a couple of issues with feeds on discord. This PR fixes both of these. --- modules/templates/helper.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/templates') diff --git a/modules/templates/helper.go b/modules/templates/helper.go index d3f6b8e06f..ab66cc7282 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -817,6 +817,10 @@ func ActionIcon(opType models.ActionType) string { func ActionContent2Commits(act Actioner) *repository.PushCommits { push := repository.NewPushCommits() + if act == nil || act.GetContent() == "" { + return push + } + json := jsoniter.ConfigCompatibleWithStandardLibrary if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil { log.Error("json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err) -- cgit v1.2.3