diff --git a/chrome/content/zotero/xpcom/data/dataObject.js b/chrome/content/zotero/xpcom/data/dataObject.js index 179ceb9642..7c0c093078 100644 --- a/chrome/content/zotero/xpcom/data/dataObject.js +++ b/chrome/content/zotero/xpcom/data/dataObject.js @@ -909,14 +909,16 @@ Zotero.DataObject.prototype._initSave = Zotero.Promise.coroutine(function* (env) } // Undo registerObject() on failure - var func = function () { - this.ObjectsClass.unload(this._id); - }.bind(this); - if (env.options.tx) { - env.transactionOptions.onRollback = func; - } - else { - Zotero.DB.addCurrentCallback("rollback", func); + if (env.isNew) { + var func = function () { + this.ObjectsClass.unload(this._id); + }.bind(this); + if (env.options.tx) { + env.transactionOptions.onRollback = func; + } + else { + Zotero.DB.addCurrentCallback("rollback", func); + } } env.relationsToRegister = [];