Fix Item.fromJSON() failure after deb17d450e

This commit is contained in:
Dan Stillman 2022-11-19 05:25:34 -05:00
parent deb17d450e
commit 1106685f2d

View file

@ -2241,7 +2241,7 @@ Zotero.Item.prototype.setNote = function(text) {
}
if (this.isEmbeddedImageAttachment()) {
throw new Error("setNote() cannot be called on embedded-image attachments")
throw new Error("setNote() cannot be called on embedded-image attachments");
}
if (typeof text != 'string') {
@ -5227,7 +5227,7 @@ Zotero.Item.prototype.fromJSON = function (json, options = {}) {
let parentKey = json.parentItem;
this.parentKey = parentKey ? parentKey : false;
if (!this.isAnnotation()) {
if (!this.isAnnotation() && !this.isEmbeddedImageAttachment()) {
let note = json.note;
this.setNote(note !== undefined ? note : "");
}