From f7edb03a7c37cbf47126363da6ee6142a9779894 Mon Sep 17 00:00:00 2001 From: Allan Chain <36528777+AllanChain@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:55:19 +0800 Subject: [PATCH] style: lint fix --- src/modules/arxiv-update.ts | 4 +++- src/modules/prefer-pdf.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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,