Fix "Export PDFs…" stopping if attachment file isn't found

This commit is contained in:
Dan Stillman 2023-09-21 02:47:00 -04:00
parent 540a174dab
commit 98c1a6ca1b

View file

@ -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;