diff options
author | 2024-06-06 12:22:16 +0200 | |
---|---|---|
committer | 2024-06-06 11:22:16 +0100 | |
commit | 6f26b32ec3ed57ed3b04cba357abb9ee5060f229 (patch) | |
tree | 9d44758d64f6d9530c1ed04c1dd1a204105f2419 /internal/typeutils | |
parent | [bugfix] concurrent map writes in dereferencer media processing maps (#2964) (diff) | |
download | gotosocial-6f26b32ec3ed57ed3b04cba357abb9ee5060f229.tar.xz |
[bugfix] Don't nil emojis + fields on blocked accounts (#2968)
* [bugfix] Don't nil emojis + fields on blocked accounts
* comment
* swagger
Diffstat (limited to 'internal/typeutils')
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 4 | ||||
-rw-r--r-- | internal/typeutils/internaltofrontend_test.go | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index abe2cfaee..68db61128 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -368,6 +368,10 @@ func (c *Converter) AccountToAPIAccountBlocked(ctx context.Context, a *gtsmodel. Bot: *a.Bot, CreatedAt: util.FormatISO8601(a.CreatedAt), URL: a.URL, + // Empty array (not nillable). + Emojis: make([]apimodel.Emoji, 0), + // Empty array (not nillable). + Fields: make([]apimodel.Field, 0), Suspended: !a.SuspendedAt.IsZero(), Role: role, } diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go index 676870c7b..946e38b30 100644 --- a/internal/typeutils/internaltofrontend_test.go +++ b/internal/typeutils/internaltofrontend_test.go @@ -420,8 +420,8 @@ func (suite *InternalToFrontendTestSuite) TestLocalInstanceAccountToFrontendBloc "following_count": 0, "statuses_count": 0, "last_status_at": null, - "emojis": null, - "fields": null + "emojis": [], + "fields": [] }`, string(b)) } |