Skip to content

Commit

Permalink
[bug] Fix crash if folder is empty after downloadFileFromStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Sep 25, 2024
1 parent c8b2593 commit 34e5c51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FileConverter/sources/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,11 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth
} else if (fs.existsSync(path.join(tempDirs.source, 'origin.pdf'))) {
dataConvert.fileFrom = path.join(tempDirs.source, 'origin.pdf');
}
let fileFromNew = path.join(path.dirname(dataConvert.fileFrom), "Editor.bin");
fs.renameSync(dataConvert.fileFrom, fileFromNew);
dataConvert.fileFrom = fileFromNew;
if (fs.existsSync(dataConvert.fileFrom)) {
let fileFromNew = path.join(path.dirname(dataConvert.fileFrom), "Editor.bin");
fs.renameSync(dataConvert.fileFrom, fileFromNew);
dataConvert.fileFrom = fileFromNew;
}
}

yield changeFormatToExtendedPdf(ctx, dataConvert, cmd);
Expand Down

0 comments on commit 34e5c51

Please sign in to comment.