Don't fail during file upload if file doesn't yet exist
This commit is contained in:
parent
c4158a5339
commit
df9439f9a2
1 changed files with 11 additions and 1 deletions
|
@ -461,8 +461,18 @@ Zotero.Sync.Storage = new function () {
|
||||||
try {
|
try {
|
||||||
request.setMaxSize(Zotero.Attachments.getTotalFileSize(item));
|
request.setMaxSize(Zotero.Attachments.getTotalFileSize(item));
|
||||||
}
|
}
|
||||||
// If this fails, it's no big deal, though we might fail later
|
// If this fails, ignore it, though we might fail later
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
// But if the file doesn't exist yet, don't try to upload it
|
||||||
|
//
|
||||||
|
// This isn't a perfect test, because the file could still be
|
||||||
|
// in the process of being downloaded. It'd be better to
|
||||||
|
// download files to a temp directory and move them into place.
|
||||||
|
if (!item.getFile()) {
|
||||||
|
Zotero.debug("File " + item.libraryKey + " not yet available to upload -- skipping");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
Zotero.debug(e, 1);
|
Zotero.debug(e, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue