Desktop: Fixes #7831: Skip the resources which haven't been downloaded yet when exporting (#7843)

pull/7869/head
Self Not Found 2023-03-03 19:31:49 +08:00 committed by GitHub
parent 4bee6ffc90
commit ad4d71dbe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ export default class InteropService_Exporter_Html extends InteropService_Exporte
for (let i = 0; i < linkedResourceIds.length; i++) {
const id = linkedResourceIds[i];
// Skip the resources which haven't been downloaded yet
if (!resourcePaths[id]) {
continue;
}
const resourceContent = `${relativePath ? `${relativePath}/` : ''}_resources/${basename(resourcePaths[id])}`;
newBody = newBody.replace(new RegExp(`:/${id}`, 'g'), resourceContent);
}