Force empty storage filenames to '_'

Hopefully fixes https://forums.zotero.org/discussion/71039/sync-error-empty-path-for-item
This commit is contained in:
Dan Stillman 2018-03-27 10:17:48 -04:00
parent a9e047cc9e
commit 24b9612a56
2 changed files with 2 additions and 2 deletions

View file

@ -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];
}

View file

@ -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')) {