Fix sync error after editing group item and leaving/deleting group

This commit is contained in:
Dan Stillman 2009-05-20 00:58:34 +00:00
parent 168ab9ca98
commit 1ae61a7ac4

View File

@ -2373,7 +2373,18 @@ Zotero.Sync.Server.Data = new function() {
elementCreated = true; 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') { if (type == 'item') {
// itemToXML needs the sync session // itemToXML needs the sync session
xml.items.appendChild(this.itemToXML(obj, syncSession)); xml.items.appendChild(this.itemToXML(obj, syncSession));