diff options
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r-- | modules/templates/helper.go | 4 |
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) |