From 4fdf43ed92aba48a3923d6d6fb90b64a569e0447 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Fri, 30 Sep 2022 09:44:27 +0300 Subject: [PATCH] Prevent error when creating a note from annotations that have ink --- chrome/content/zotero/xpcom/editorInstance.js | 3 ++- chrome/content/zotero/zoteroPane.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index e2f7dcffce..92662ef2b8 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -1398,7 +1398,8 @@ class EditorInstanceUtilities { if (!annotation.text && !annotation.comment - && !annotation.imageAttachmentKey) { + && !annotation.imageAttachmentKey + || annotation.type === 'ink') { continue; } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index c25df396da..846c9e64bf 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -5049,7 +5049,7 @@ var ZoteroPane = new function() catch (e) { Zotero.logError(e); } - annotations.push(...attachment.getAnnotations()); + annotations.push(...attachment.getAnnotations().filter(x => x.annotationType != 'ink')); } var note = await Zotero.EditorInstance.createNoteFromAnnotations( annotations, @@ -5145,7 +5145,7 @@ var ZoteroPane = new function() catch (e) { Zotero.logError(e); } - annotations.push(...attachment.getAnnotations()); + annotations.push(...attachment.getAnnotations().filter(x => x.annotationType != 'ink')); } }