diff --git a/src/modules/arxiv-update.ts b/src/modules/arxiv-update.ts index 991defa..1c55bd8 100644 --- a/src/modules/arxiv-update.ts +++ b/src/modules/arxiv-update.ts @@ -257,7 +257,9 @@ class PaperFinder { ); return; } - for (const idInfo of info?.articleids) { + const idInfos = info?.articleids; + if (!idInfos) return undefined; + for (const idInfo of idInfos) { if (idInfo.idtype === "doi") { return { doi: idInfo.value, title: "Published PDF" }; } diff --git a/src/modules/prefer-pdf.ts b/src/modules/prefer-pdf.ts index c05af63..e12916a 100644 --- a/src/modules/prefer-pdf.ts +++ b/src/modules/prefer-pdf.ts @@ -17,7 +17,8 @@ export class PreferPDF { return true; }, commandListener: async (ev) => { - const selectedAttachment = Zotero.getActiveZoteroPane().getSelectedItems()[0]; + const selectedAttachment = + Zotero.getActiveZoteroPane().getSelectedItems()[0]; PreferPDF.prefer(selectedAttachment); }, icon: menuIcon,