From b4006f591ce6e4f68944a1f6387b5911a2b7e5bc Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 15 Jan 2025 10:40:26 +0100 Subject: [PATCH] fix: upatate migration script --- .../migration/migrations/1735836154221-v-2-2-0.migration.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(