Skip to content

Commit

Permalink
fix: skip items without time
Browse files Browse the repository at this point in the history
some items may not have time set, it was panicking.
fix #22
  • Loading branch information
guilhem committed May 3, 2022
1 parent a9b32f1 commit 11a7514
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ func main() {

// Remove old items in feed
feed.Items = funk.Filter(feed.Items, func(x *gofeed.Item) bool {
return x.PublishedParsed.After(limitTime)
if x.PublishedParsed != nil {
return x.PublishedParsed.After(limitTime)
}
a.Infof("Item don't have a publish date, skip limitTime")
return true
}).([]*gofeed.Item)

// Get all issues
Expand Down

0 comments on commit 11a7514

Please sign in to comment.