Skip to content

Commit

Permalink
[bug] Fix crash while applying changes to pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Aug 6, 2024
1 parent f878e94 commit 767e5b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FileConverter/sources/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth
});
}
}
yield changeFormatToExtendedPdf(ctx, dataConvert, cmd);
//todo rework
if (!fs.existsSync(dataConvert.fileFrom)) {
if (fs.existsSync(path.join(tempDirs.source, 'origin.docx'))) {
Expand All @@ -529,12 +528,16 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth
dataConvert.fileFrom = path.join(tempDirs.source, 'origin.xlsx');
} else if (fs.existsSync(path.join(tempDirs.source, 'origin.pptx'))) {
dataConvert.fileFrom = path.join(tempDirs.source, 'origin.pptx');
} 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;
}

yield changeFormatToExtendedPdf(ctx, dataConvert, cmd);

if (task.getFromChanges() && !(task.getFromOrigin() || task.getFromSettings())) {
let sha256 = yield utils.checksumFile('sha256', dataConvert.fileFrom)
if(tenEditor['binaryChanges']) {
Expand Down

0 comments on commit 767e5b1

Please sign in to comment.