fix: Convert sql.NullString to []byte for JSON unmarshaling

This commit is contained in:
Erik Winter (aider) 2024-12-21 14:06:03 +01:00
parent fc2a0e32cf
commit 3646aa0961
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ func (p *Postgres) RecursBefore(date time.Time) ([]item.Item, error) {
}
if recurrerJSON.Valid && recurrerJSON.String != "" {
var recurrer item.Recur
if err := json.Unmarshal(recurrerJSON, &recurrer); err != nil {
if err := json.Unmarshal([]byte(recurrerJSON.String), &recurrer); err != nil {
return nil, fmt.Errorf("%w: %v", ErrPostgresFailure, err)
}
i.Recurrer = &recurrer