diff --git a/chrome/content/zotero/contextPane.js b/chrome/content/zotero/contextPane.js index e8b53bfc22..05cf3c31a4 100644 --- a/chrome/content/zotero/contextPane.js +++ b/chrome/content/zotero/contextPane.js @@ -437,9 +437,11 @@ var ZoteroContextPane = new function () { if (!attachment) { return; } - var note = await Zotero.EditorInstance.createNoteFromAnnotations( - attachment.getAnnotations().filter(x => x.annotationType != 'ink'), child && attachment.parentID - ); + var annotations = attachment.getAnnotations().filter(x => x.annotationType != 'ink'); + if (!annotations.length) { + return; + } + var note = await Zotero.EditorInstance.createNoteFromAnnotations(annotations, child && attachment.parentID); _updateAddToNote(); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 76361944bd..1985ff26e4 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -4824,9 +4824,11 @@ var ZoteroPane = new function() return; } await Zotero.PDFWorker.import(attachment.id, true); - var note = await Zotero.EditorInstance.createNoteFromAnnotations( - attachment.getAnnotations().filter(x => x.annotationType != 'ink'), attachment.parentID - ); + var annotations = attachment.getAnnotations().filter(x => x.annotationType != 'ink'); + if (!annotations.length) { + return; + } + var note = await Zotero.EditorInstance.createNoteFromAnnotations(annotations, attachment.parentID); if (!skipSelect) { await this.selectItem(note.id); } @@ -4864,7 +4866,9 @@ var ZoteroPane = new function() attachment, { skipSelect: true } ); - itemIDsToSelect.push(note.id); + if (note) { + itemIDsToSelect.push(note.id); + } } } await this.selectItems(itemIDsToSelect); diff --git a/note-editor b/note-editor index 1a3fa7b30d..fb3daf6c7e 160000 --- a/note-editor +++ b/note-editor @@ -1 +1 @@ -Subproject commit 1a3fa7b30df0a1530d49042a308e0840ac907f1a +Subproject commit fb3daf6c7e1d7a91992deeea52889cb9c95972f7