From ad4d71dbe187254ea0aabe9d4c9258a6b46a899b Mon Sep 17 00:00:00 2001 From: Self Not Found Date: Fri, 3 Mar 2023 19:31:49 +0800 Subject: [PATCH] Desktop: Fixes #7831: Skip the resources which haven't been downloaded yet when exporting (#7843) --- packages/lib/services/interop/InteropService_Exporter_Html.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/lib/services/interop/InteropService_Exporter_Html.ts b/packages/lib/services/interop/InteropService_Exporter_Html.ts index 97737209d..71897d856 100644 --- a/packages/lib/services/interop/InteropService_Exporter_Html.ts +++ b/packages/lib/services/interop/InteropService_Exporter_Html.ts @@ -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); }