common: timeline items can be null?

This commit is contained in:
2025-08-26 11:36:51 +02:00
parent e96f4d343b
commit 923bcd89db

View File

@@ -782,10 +782,13 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
LogDebug("page:", page, "len:", resCount)
page++
retData = append(retData, res.Payload...)
for _, d := range res.Payload {
if d != nil {
retData = append(retData, d)
}
}
}
LogDebug("total results:", len(retData))
slices.SortFunc(retData, func(a, b *models.TimelineComment) int {
return time.Time(b.Created).Compare(time.Time(a.Created))
})