diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index 20fccec21..60e25c0df 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -83,7 +83,7 @@ export class MastoConverters { } return 'unknown'; } - + public encodeFile(f: any): Entity.Attachment { return { id: f.id, @@ -279,7 +279,8 @@ export class MastoConverters { emoji_reactions: status.emoji_reactions, bookmarked: false, quote: isQuote ? await this.convertReblog(status.reblog) : false, - edited_at: note.updatedAt?.toISOString(), + // optional chaining cannot be used, as it evaluates to undefined, not null + edited_at: note.updatedAt ? note.updatedAt.toISOString() : null, }); } }