summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-03-06 04:09:49 +0000
committerGitHub <noreply@github.com>2021-03-06 05:09:49 +0100
commit20f13bfdfc5f801e6db319d8d87da0ee139aa32e (patch)
tree4d4b3696379aeba04f0b78ea18ec869e299b0d2e /modules/templates
parentfd4b309c6f15ad0770067f42ed9a5a6abace3d96 (diff)
downloadgitea-20f13bfdfc5f801e6db319d8d87da0ee139aa32e.tar.gz
gitea-20f13bfdfc5f801e6db319d8d87da0ee139aa32e.zip
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.
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/helper.go4
1 files changed, 4 insertions, 0 deletions
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)