From f952efd9c72b947d70e63ba69d08214aaeddca30 Mon Sep 17 00:00:00 2001 From: DaneEveritt Date: Sun, 24 Jul 2022 16:27:05 -0400 Subject: [PATCH] Don't try to store nil for the metadata --- internal/models/activity.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/models/activity.go b/internal/models/activity.go index 1c3623b..bbbe38d 100644 --- a/internal/models/activity.go +++ b/internal/models/activity.go @@ -60,5 +60,8 @@ func (a *Activity) BeforeCreate(_ *gorm.DB) error { a.Timestamp = time.Now() } a.Timestamp = a.Timestamp.UTC() + if a.Metadata == nil { + a.Metadata = ActivityMeta{} + } return nil }