Browse Source

@uppy/aws-s3-multipart: fix `TypeError` (#4748)

When chunks have already been uploaded, they are removed from memory.
If the user resume an upload whose first chunk has been uploaded, they
were getting a `TypeError` back.
Antoine du Hamel 1 year ago
parent
commit
91b7ca370e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/@uppy/aws-s3-multipart/src/index.js

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/index.js

@@ -320,7 +320,7 @@ class HTTPCommunicationQueue {
 
   async resumeUploadFile (file, chunks, signal) {
     throwIfAborted(signal)
-    if (chunks.length === 1 && !chunks[0].shouldUseMultipart) {
+    if (chunks.length === 1 && chunks[0] != null && !chunks[0].shouldUseMultipart) {
       return this.#nonMultipartUpload(file, chunks[0], signal)
     }
     const { uploadId, key } = await this.getUploadId(file, signal)