From 2cdf637d59ddde999d059607d0d254d87825d72a Mon Sep 17 00:00:00 2001 From: Miha Lunar Date: Sun, 31 Jul 2022 21:21:36 +0200 Subject: [PATCH] Logging error hotfix --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2c799b6..6ffcc68 100644 --- a/main.go +++ b/main.go @@ -993,7 +993,10 @@ func main() { for i := range collections { collection := &collections[i] collection.UpdateStatus(imageSource) - indexedAgo := durafmt.Parse(time.Since(*collection.IndexedAt)).LimitFirstN(1) + indexedAgo := "N/A" + if collection.IndexedAt != nil { + indexedAgo = durafmt.Parse(time.Since(*collection.IndexedAt)).LimitFirstN(1).String() + } log.Printf(" %v - %v files indexed %v ago", collection.Name, collection.IndexedCount, indexedAgo) }