From 706583fa4baf438d7281880ba215c6e40a4d3442 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 16 Sep 2009 11:29:49 +0000 Subject: [PATCH] Log but don't throw an error if a synced file is missing after extracting a ZIP file -- this can happen if a filename is changed and synced elsewhere but the renamed file wasn't synced, so the ZIP doesn't ontain a file with the known name --- chrome/content/zotero/xpcom/storage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 0bc67397b..f044ae4e6 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -575,7 +575,13 @@ Zotero.Sync.Storage = new function () { var file = item.getFile(); if (!file) { - throw ("File not found for item " + item.id + " after processing download in " + funcName); + // This can happen if an HTML snapshot filename was changed and synced + // elsewhere but the renamed file wasn't synced, so the ZIP doesn't + // contain a file with the known name + var missingFile = item.getFile(null, true); + Components.utils.reportError("File '" + missingFile.leafName + "' not found after processing download " + + item.libraryID + "/" + item.key + " in " + funcName); + return; } file.lastModifiedTime = syncModTime * 1000;