mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-26 10:15:13 +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
|
// Try to use updated time first, then published
|
||||||
|
|
||||||
if !item.UpdatedParsed.IsZero() {
|
if item.UpdatedParsed != nil && !item.UpdatedParsed.IsZero() {
|
||||||
pub = *item.UpdatedParsed
|
pub = *item.UpdatedParsed
|
||||||
} else if !item.PublishedParsed.IsZero() {
|
} else if item.PublishedParsed != nil && !item.PublishedParsed.IsZero() {
|
||||||
pub = *item.PublishedParsed
|
pub = *item.PublishedParsed
|
||||||
} else {
|
} else {
|
||||||
// No time on the post
|
// No time on the post, use now
|
||||||
pub = time.Now()
|
pub = time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user