commit 1ae61a7ac456dea9641882a82df1c6431860374b
parent 168ab9ca980b1cf8c07b10ff51ed13be4acc8f2f
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 20 May 2009 00:58:34 +0000
Fix sync error after editing group item and leaving/deleting group
Diffstat:
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git 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));