fix: runItemTemplate bug

This commit is contained in:
windingwind 2023-09-11 15:00:54 +08:00
parent 31133cef20
commit 912b6a088f

View File

@ -147,7 +147,12 @@ async function runItemTemplate(
return "";
}
const targetNoteItem = Zotero.Items.get(targetNoteId || -1);
let targetNoteItem: Zotero.Item | undefined = Zotero.Items.get(
targetNoteId || -1,
);
if (!targetNoteItem) {
targetNoteItem = undefined;
}
const items = itemIds?.map((id) => Zotero.Items.get(id)) || [];