From 24b9612a563c0cfc2353374ba63d3e2f1b067943 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 27 Mar 2018 10:17:48 -0400 Subject: [PATCH] Force empty storage filenames to '_' Hopefully fixes https://forums.zotero.org/discussion/71039/sync-error-empty-path-for-item --- chrome/content/zotero/xpcom/data/item.js | 2 +- chrome/content/zotero/xpcom/storage/storageLocal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 023bd1cdcc..83a3d1df7e 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2810,7 +2810,7 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentFilename', { if (!path) { return ''; } - var prefixedPath = path.match(/^(?:attachments|storage):(.+)$/); + var prefixedPath = path.match(/^(?:attachments|storage):(.*)$/); if (prefixedPath) { return prefixedPath[1]; } diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index fb18e70679..d173f53645 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -687,7 +687,7 @@ Zotero.Sync.Storage.Local = { var filename = item.attachmentFilename; if (!filename) { - throw new Error("Empty path for item " + item.key); + Zotero.debug("Empty filename for item " + item.key, 2); } // Don't save Windows aliases if (filename.endsWith('.lnk')) {