浏览代码

Update hdf5.js

Lutz Roeder 3 年之前
父节点
当前提交
b28f4746cf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      source/hdf5.js

+ 1 - 1
source/hdf5.js

@@ -202,7 +202,7 @@ hdf5.Variable = class {
     get value() {
         const data = this.data;
         if (data) {
-            const reader = new hdf5.BinaryReader(data);
+            const reader = data instanceof hdf5.BinaryReader ? data : new hdf5.BinaryReader(data);
             const array = this._dataspace.read(this._datatype, reader);
             return this._dataspace.decode(this._datatype, array, array, this._globalHeap);
         }