diff --git a/pkg/repository/postgres/sqlchelpers/uuid.go b/pkg/repository/postgres/sqlchelpers/uuid.go index 517a7eb5a..16f3d6891 100644 --- a/pkg/repository/postgres/sqlchelpers/uuid.go +++ b/pkg/repository/postgres/sqlchelpers/uuid.go @@ -1,11 +1,16 @@ package sqlchelpers import ( + "github.com/google/uuid" "github.com/jackc/pgx/v5/pgtype" ) -func UUIDToStr(uuid pgtype.UUID) string { - return uuid.String() +func UUIDToStr(u pgtype.UUID) string { + if !u.Valid { + return uuid.Nil.String() + } + + return u.String() } func UUIDFromStr(uuid string) pgtype.UUID {