From 1ae61a7ac456dea9641882a82df1c6431860374b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 20 May 2009 00:58:34 +0000 Subject: [PATCH] Fix sync error after editing group item and leaving/deleting group --- chrome/content/zotero/xpcom/sync.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 2904e4e20a..7516603974 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -2373,7 +2373,18 @@ Zotero.Sync.Server.Data = new function() { elementCreated = true; } - var obj = Zotero[Types].getByLibraryAndKey(parseInt(libraryID), key); + var l = parseInt(libraryID); + l = l ? l : null; + var obj = Zotero[Types].getByLibraryAndKey(l, key); + if (!obj) { + Zotero.debug("Updated " + type + " " + l + "/" + key + " has disappeared -- skipping"); + syncSession.removeFromUpdated({ + objectType: type, + libraryID: l, + key: key + }); + continue; + } if (type == 'item') { // itemToXML needs the sync session xml.items.appendChild(this.itemToXML(obj, syncSession));