mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-22 15:46:51 +03:00
Prevent potential nil error on timestamps
This commit is contained in:
parent
f6e89fdaa1
commit
71be668652
@ -61,12 +61,12 @@ func GetPageEntries() *PageEntries {
|
||||
|
||||
// Try to use updated time first, then published
|
||||
|
||||
if !item.UpdatedParsed.IsZero() {
|
||||
if item.UpdatedParsed != nil && !item.UpdatedParsed.IsZero() {
|
||||
pub = *item.UpdatedParsed
|
||||
} else if !item.PublishedParsed.IsZero() {
|
||||
} else if item.PublishedParsed != nil && !item.PublishedParsed.IsZero() {
|
||||
pub = *item.PublishedParsed
|
||||
} else {
|
||||
// No time on the post
|
||||
// No time on the post, use now
|
||||
pub = time.Now()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user