diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index 295017cf6..b7c8ccc68 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -251,8 +251,14 @@ return; } - // Update note var noteField = this._id('noteField'); + var value = noteField.value; + if (value === null) { + Zotero.debug("Note value not available -- not saving", 2); + return; + } + + // Update note if (this.item) { // If note field doesn't match item, abort save and run error handler if (noteField.getAttribute('itemID') != this.item.id) { @@ -263,7 +269,7 @@ throw new Error("Note field doesn't match current item"); } - let changed = this.item.setNote(noteField.value); + let changed = this.item.setNote(value); if (changed && this.saveOnEdit) { this.noteField.changed = false; yield this.item.saveTx({ @@ -280,7 +286,7 @@ if (this.parentItem) { item.libraryID = this.parentItem.libraryID; } - item.setNote(noteField.value); + item.setNote(value); if (this.parentItem) { item.parentKey = this.parentItem.key; } diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index f6e9e03c2..9214a5a59 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -500,6 +500,10 @@