www

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

commit 11f2810586fff92f3660d02e19f6e7f017925a03
parent fdcc02d953cf5dc046d9716581263c1fe2ea7f39
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 10 Nov 2008 09:42:57 +0000

Fix "New Zotero.Item objects shouldn't be accessed after save" warning during sync


Diffstat:
Mchrome/content/zotero/xpcom/sync.js | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -1834,16 +1834,15 @@ Zotero.Sync.Server.Data = new function() { Zotero.debug('Saving merged ' + types); // Save parent items first if (type == 'item') { - for each(var obj in toSave) { - if (!obj.getSource()) { - obj.save(); + for (var i=0; i<toSave.length; i++) { + if (!toSave[i].getSource()) { + toSave[i].save(); + toSave.splice(i, 1); + i--; } } } for each(var obj in toSave) { - if (type == 'item' && !obj.getSource()) { - continue; - } obj.save(); }