@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.
This commit is contained in:
Antoine du Hamel 2023-10-20 14:46:57 +02:00 committed by GitHub
parent 0e2d8f63d5
commit 91b7ca370e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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