diff --git a/chrome/content/zotero/elements/abstractBox.js b/chrome/content/zotero/elements/abstractBox.js index f5bd62d954..010591a4c0 100644 --- a/chrome/content/zotero/elements/abstractBox.js +++ b/chrome/content/zotero/elements/abstractBox.js @@ -89,9 +89,15 @@ } async save() { - if (this.item) { - this.item.setField('abstractNote', this._abstractField.value); - await this.item.saveTx(); + if (!this.editable) { + return; + } + if (this._item) { + if (!this._item.itemID) { + throw new Error('Item has not been added to library'); + } + this._item.setField('abstractNote', this._abstractField.value); + await this._item.saveTx(); } this._forceRenderAll(); } diff --git a/chrome/content/zotero/elements/itemPaneHeader.js b/chrome/content/zotero/elements/itemPaneHeader.js index edd8338187..52289722a4 100644 --- a/chrome/content/zotero/elements/itemPaneHeader.js +++ b/chrome/content/zotero/elements/itemPaneHeader.js @@ -180,7 +180,13 @@ } async save() { + if (!this.editable) { + return; + } if (this._item) { + if (!this._item.itemID) { + throw new Error('Item has not been added to library'); + } this._item.setField(this._titleFieldID, this.titleField.value); await this._item.saveTx(); }