diff options
author | Andy Rickert <andrew_rickert@brown.edu> | 2020-04-02 17:42:18 -0700 |
---|---|---|
committer | Andy Rickert <andrew_rickert@brown.edu> | 2020-04-02 17:42:18 -0700 |
commit | fb329b1a8abca361d831c7ec1f1a9ea0f3d410cf (patch) | |
tree | e09138a0544fe3814b1bd1e95d59bc4c0e96f5ed /src/server/ApiManagers/DownloadManager.ts | |
parent | 3a1dac48c00dbe81142da90f8b52bfae02ce1921 (diff) | |
parent | b4958eac84339dd7a88c964a9c52e89481048f55 (diff) |
merge
Diffstat (limited to 'src/server/ApiManagers/DownloadManager.ts')
-rw-r--r-- | src/server/ApiManagers/DownloadManager.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/ApiManagers/DownloadManager.ts b/src/server/ApiManagers/DownloadManager.ts index 1bb84f374..01d2dfcad 100644 --- a/src/server/ApiManagers/DownloadManager.ts +++ b/src/server/ApiManagers/DownloadManager.ts @@ -254,11 +254,13 @@ async function writeHierarchyRecursive(file: Archiver.Archiver, hierarchy: Hiera // and dropped in the browser and thus hosted remotely) so we upload it // to our server and point the zip file to it, so it can bundle up the bytes const information = await DashUploadUtils.UploadImage(result); - path = information.serverAccessPaths[SizeSuffix.Original]; + path = information instanceof Error ? "" : information.accessPaths[SizeSuffix.Original].server; } // write the file specified by the path to the directory in the // zip file given by the prefix. - file.file(path, { name: documentTitle, prefix }); + if (path) { + file.file(path, { name: documentTitle, prefix }); + } } else { // we've hit a collection, so we have to recurse await writeHierarchyRecursive(file, result, `${prefix}/${documentTitle}`); |