Check dereference error

This commit is contained in:
Thomas Krijnen
2017-11-24 12:15:30 +01:00
parent 839dd9aed6
commit 34fd334fcb
+7 -2
View File
@@ -1942,9 +1942,14 @@ public:
return inst_name;
} else if (dt->getClass() == H5T_REFERENCE) {
hid_t setid = H5Rdereference(file_.getId(), H5R_DATASET_REGION, data);
hid_t setid = H5Rdereference(file().getId(), H5R_DATASET_REGION, data);
hid_t spaceid = H5Rget_region(file().getId(), H5R_DATASET_REGION, data);
if (setid == -1) {
throw std::runtime_error("Failed to dereference");
}
hid_t spaceid = H5Rget_region(file_.getId(), H5R_DATASET_REGION, data);
H5::DataSet dset(setid);
H5::DataSpace dspace(spaceid);