Skip to content

Commit 0ecbb71

Browse files
authored
Fix 500 on time in timeline API (go-gitea#21052) (go-gitea#21057)
Backport go-gitea#21052 Before converting a TrackedTime for the API we need to load its attributes - otherwise we get an NPE. Fix go-gitea#21041
1 parent ea38455 commit 0ecbb71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/convert/issue_comment.go

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ func ToTimelineComment(c *issues_model.Comment, doer *user_model.User) *api.Time
101101
}
102102

103103
if c.Time != nil {
104+
err = c.Time.LoadAttributes()
105+
if err != nil {
106+
log.Error("Time.LoadAttributes: %v", err)
107+
return nil
108+
}
109+
104110
comment.TrackedTime = ToTrackedTime(c.Time)
105111
}
106112

0 commit comments

Comments
 (0)