diff --git a/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js b/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js index 0d846bad1c..d3024594c6 100644 --- a/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js +++ b/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js @@ -139,6 +139,9 @@ export default class FilesImportJob extends Job { async deleteOrphanFiles() { const { context, tx } = this const { dryRun, filesToDeleteByUuid, updatedFilesByUuid, surveyId } = context + + if (Objects.isEmpty(filesToDeleteByUuid)) return + const filesToDeleteArray = Object.values(filesToDeleteByUuid) for await (const file of filesToDeleteArray) { const fileUuid = RecordFile.getUuid(file)