diff --git a/internal/stores/store.go b/internal/stores/store.go index c86cfaa..64745a3 100644 --- a/internal/stores/store.go +++ b/internal/stores/store.go @@ -74,10 +74,9 @@ func (s *Store) GetEntryByID(id string) (*shared.Entry, error) { func (s *Store) GetEntryAndIncrease(id string) (*shared.Entry, error) { entry, err := s.GetEntryByID(id) if err != nil { - errors.Wrap(err, "could not fetch entry "+id) - return nil, err + return nil, errors.Wrap(err, "could not fetch entry "+id) } - if entry.Public.Expiration != nil && time.Now().After(*entry.Public.Expiration) { + if entry.Public.Expiration != nil && !entry.Public.Expiration.IsZero() && time.Now().After(*entry.Public.Expiration) { return nil, ErrEntryIsExpired } if err := s.storage.IncreaseVisitCounter(id); err != nil {