Browse Source

fix: null check before replacing path

nc-feat/attachment-clean-up
mertmit 4 months ago
parent
commit
95eb661a5b
  1. 2
      packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts

2
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\//,

Loading…
Cancel
Save