[bug] Fix crash while applying changes to pdf

This commit is contained in:
Sergey Konovalov
2024-08-07 00:33:20 +03:00
parent f878e941d5
commit 767e5b1209

View File

@ -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'))) {
@ -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']) {