Fix a couple of issues with a feeds (#14897) (#14903)

Backport (#14897)

witch fix couple of issues with feeds
This commit is contained in:
6543 authored and GitHub committed 2021-03-06 06:13:38 +01:00
1 parent da80e90ac8
commit 8e792986bb
2 files changed
+7 -1

No files matched your search

+5
View File
@@ -689,6 +689,11 @@ func ActionIcon(opType models.ActionType) string {
// ActionContent2Commits converts action content to push commits
func ActionContent2Commits(act Actioner) *repository.PushCommits {
push := repository.NewPushCommits()
if act == nil || act.GetContent() == "" {
return push
}
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
log.Error("json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err)
}