Force empty storage filenames to '_'
Hopefully fixes https://forums.zotero.org/discussion/71039/sync-error-empty-path-for-item
This commit is contained in:
parent
a9e047cc9e
commit
24b9612a56
|
@ -2810,7 +2810,7 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentFilename', {
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
var prefixedPath = path.match(/^(?:attachments|storage):(.+)$/);
|
var prefixedPath = path.match(/^(?:attachments|storage):(.*)$/);
|
||||||
if (prefixedPath) {
|
if (prefixedPath) {
|
||||||
return prefixedPath[1];
|
return prefixedPath[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -687,7 +687,7 @@ Zotero.Sync.Storage.Local = {
|
||||||
|
|
||||||
var filename = item.attachmentFilename;
|
var filename = item.attachmentFilename;
|
||||||
if (!filename) {
|
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
|
// Don't save Windows aliases
|
||||||
if (filename.endsWith('.lnk')) {
|
if (filename.endsWith('.lnk')) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user