Skip to content

Commit

Permalink
fix: handle PublishedParsed nil value
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBigRoomXXL committed Sep 13, 2023
1 parent bd2dc97 commit 670125e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func tinyfeed(cmd *cobra.Command, args []string) {
}

sort.SliceStable(items, func(i, j int) bool {
if items[i].PublishedParsed == nil {
return false
}
if items[j].PublishedParsed == nil {
return true
}
return items[i].PublishedParsed.After(*items[j].PublishedParsed)
})

Expand Down

0 comments on commit 670125e

Please sign in to comment.