From 95eb661a5b05f7b56f9b803f6e6b45299982eb9b Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 10 Aug 2024 07:31:57 +0000 Subject: [PATCH] fix: null check before replacing path --- .../src/modules/jobs/migration-jobs/nc_job_001_attachment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts b/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts index e7f9a2f8a0..c3de89516a 100644 --- a/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts +++ b/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts @@ -295,7 +295,7 @@ export class AttachmentMigrationProcessor { for (const attachment of attachmentArr) { if ('path' in attachment || 'url' in attachment) { const filePath = `nc/uploads/${ - attachment.path.replace(/^download\//, '') || + attachment.path?.replace(/^download\//, '') || decodeURI( `${new URL(attachment.url).pathname.replace( /.*?nc\/uploads\//,