From 43da070c54473c20599ce5e0e3fa6eb4a3f3b613 Mon Sep 17 00:00:00 2001 From: John Davis Date: Fri, 31 May 2024 13:46:34 -0400 Subject: [PATCH] Check if file not null before accessing --- client/src/utils/upload-queue.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/utils/upload-queue.js b/client/src/utils/upload-queue.js index 854ae90de567..a3a43bd8c5b1 100644 --- a/client/src/utils/upload-queue.js +++ b/client/src/utils/upload-queue.js @@ -51,8 +51,10 @@ export class UploadQueue { // Remove file from queue and file set by index remove(index) { const file = this.queue.get(index); - const fileSetKey = file.name + file.size; - this.queue.delete(index) && this.fileSet.delete(fileSetKey); + if (file) { + const fileSetKey = file.name + file.size; + this.queue.delete(index) && this.fileSet.delete(fileSetKey); + } } // Remove all entries from queue