浏览代码

@uppy/core: fix `TypeError` when file was removed (#3650)

Antoine du Hamel 3 年之前
父节点
当前提交
066008ef41
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/@uppy/core/src/Uppy.js

+ 1 - 1
packages/@uppy/core/src/Uppy.js

@@ -851,7 +851,7 @@ class Uppy {
   }
 
   calculateProgress (file, data) {
-    if (!this.getFile(file.id)) {
+    if (file == null || !this.getFile(file.id)) {
       this.log(`Not setting progress for a file that has been removed: ${file.id}`)
       return
     }