From deb17d450ed71c2e699f69d511cfe33c79196dbb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 19 Nov 2022 04:54:55 -0500 Subject: [PATCH] Don't allow note on embedded-image attachments https://github.com/windingwind/zotero-better-notes/issues/212 --- chrome/content/zotero/xpcom/data/item.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 840140fa2f..5e067df34d 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2240,6 +2240,10 @@ Zotero.Item.prototype.setNote = function(text) { throw ("updateNote() can only be called on notes and attachments"); } + if (this.isEmbeddedImageAttachment()) { + throw new Error("setNote() cannot be called on embedded-image attachments") + } + if (typeof text != 'string') { throw ("text must be a string in Zotero.Item.setNote() (was " + typeof text + ")"); }