www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 9b9773db165184359f04e3a882170328761e4b78
parent a4aabd9f3e9caafe588706d19a9fcae925f9abdd
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 29 Mar 2018 07:40:31 -0400

Skip items in save session that no longer exist

Ideally I guess the entry would be removed from the save popup in the
connector and a second button click would do a fresh save rather than
reopening the popup, but for now just avoid an error.

Addresses zotero/zotero-connectors#220

Diffstat:
Mchrome/content/zotero/xpcom/server_connector.js | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js @@ -200,6 +200,10 @@ Zotero.Server.Connector.SaveSession.prototype._updateObjects = async function (o // a child item (e.g., from Retrieve Metadata for PDF) if (objectType == 'item') { let item = object.isTopLevelItem() ? object : object.parentItem; + if (!Zotero.Items.exists(item.id)) { + Zotero.debug(`Item ${item.id} in save session no longer exists`); + continue; + } // Keep automatic tags let originalTags = item.getTags().filter(tag => tag.type == 1); item.setTags(originalTags.concat(tags));