Skip to content

Commit

Permalink
fix: Check if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
PMax5 committed Mar 31, 2023
1 parent a52aa24 commit 2343ce1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/resources/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ async function zipFiles(links) {
if (files) {
await async.eachSeries(files, async (file) => {
log.info({ file: `Processing CV file: ${file.id}` })
const fileExists = fs.existsSync(`${config.upload.path}/${file.id}`)
if (!fileExists) {
return
}

let link = links.find((link) => { return link.attendee === file.user })
let user = await server.methods.user.get({ 'id': file.user })
let fileData = fs.readFileSync(`${config.upload.path}/${file.id}`)
Expand Down

0 comments on commit 2343ce1

Please sign in to comment.