浏览代码

fix error handling in readData

Alexander Rose 5 年之前
父节点
当前提交
4416178d6f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/mol-util/data-source.ts

+ 1 - 1
src/mol-util/data-source.ts

@@ -78,7 +78,7 @@ function readData<T extends XMLHttpRequest | FileReader>(ctx: RuntimeContext, ac
         // first check if data reading is already done
         if (isDone(data)) {
             const { error } = data as FileReader;
-            if (error !== null) {
+            if (error !== null && error !== undefined) {
                 reject(error ?? 'Failed.');
             } else {
                 resolve(data);