File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -113,18 +113,19 @@ class Hdf5DataSet {
113113 }
114114
115115 std::vector<uint64_t > get_dimensions (){
116+ if (dataspace_id > -1 ) {
117+ const int ndims = H5Sget_simple_extent_ndims (dataspace_id);
118+ std::vector<hsize_t > _dims;
119+ _dims.resize (ndims, 0 );
116120
117- const int ndims = H5Sget_simple_extent_ndims (dataspace_id);
118- std::vector<hsize_t > _dims;
119- _dims.resize (ndims,0 );
121+ H5Sget_simple_extent_dims (dataspace_id, _dims.data (), NULL );
120122
121- H5Sget_simple_extent_dims (dataspace_id, _dims.data (), NULL );
122-
123- std::vector<uint64_t > dims_u64;
124- dims_u64.resize (ndims,0 );
125- std::copy (_dims.begin (),_dims.end (),dims_u64.begin ());
126-
127- return dims_u64;
123+ std::vector<uint64_t > dims_u64;
124+ dims_u64.resize (ndims, 0 );
125+ std::copy (_dims.begin (), _dims.end (), dims_u64.begin ());
126+ return dims_u64;
127+ }
128+ return {};
128129 }
129130
130131
You can’t perform that action at this time.
0 commit comments