diff --git a/api/src/migration/migrations/1735836154221-v-2-2-0.migration.ts b/api/src/migration/migrations/1735836154221-v-2-2-0.migration.ts index 843ed4ae..9dd667db 100644 --- a/api/src/migration/migrations/1735836154221-v-2-2-0.migration.ts +++ b/api/src/migration/migrations/1735836154221-v-2-2-0.migration.ts @@ -442,7 +442,10 @@ const migrateAttachmentMessages = async ({ type: response.headers['content-type'], channel: {}, }); - await updateAttachmentId(msg._id, attachment.id); + + if (attachment) { + await updateAttachmentId(msg._id, attachment.id); + } } } else { logger.warn(