From 98c1a6ca1bd2beb1c0ff5fbbd1466a9f43debf74 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 21 Sep 2023 02:47:00 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20"Export=20PDFs=E2=80=A6"=20stopping=20if?= =?UTF-8?q?=20attachment=20file=20isn't=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome/content/zotero/xpcom/pdfWorker/manager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/pdfWorker/manager.js b/chrome/content/zotero/xpcom/pdfWorker/manager.js index 1e2c3113db..837db8fb68 100644 --- a/chrome/content/zotero/xpcom/pdfWorker/manager.js +++ b/chrome/content/zotero/xpcom/pdfWorker/manager.js @@ -188,6 +188,10 @@ class PDFWorker { }); } let attachmentPath = await attachment.getFilePathAsync(); + if (!attachmentPath) { + Zotero.warn("Not exporting missing file " + attachment.getFilePath()); + return 0; + } let buf = await IOUtils.read(attachmentPath); buf = new Uint8Array(buf).buffer;