From f7b4cf907bdae3e98d6f2cfb07e6345c837bf4de Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Fri, 3 Jan 2025 06:48:31 +0100 Subject: [PATCH] Fix export error of item.tags being undefined (#4962) Item generated from embedded image attachment may not have attribute `tags`. --- chrome/content/zotero/xpcom/utilities_internal.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 5291ce7d58..86c12b4f9a 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -938,11 +938,13 @@ Zotero.Utilities.Internal = { } // Tags - for (let i = 0; i < item.tags.length; i++) { - if (!item.tags[i].type) { - item.tags[i].type = 0; + if (item.tags) { + for (let i = 0; i < item.tags.length; i++) { + if (!item.tags[i].type) { + item.tags[i].type = 0; + } + // No translator ever used "primary", "fields", or "linkedItems" objects } - // No translator ever used "primary", "fields", or "linkedItems" objects } // "related" was never used (array of itemIDs)