Skip to content

Commit

Permalink
Check if file not null before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed May 31, 2024
1 parent 60787f8 commit 43da070
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/utils/upload-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43da070

Please sign in to comment.