Skip to content

Commit

Permalink
Fix some error conditions in HDF5 backend
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel authored Mar 31, 2022
1 parent 1985a70 commit 4e2719e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/IO/HDF5/HDF5IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ void HDF5IOHandlerImpl::openPath(

node_id = H5Gopen(
file.id, concrete_h5_file_position(writable->parent).c_str(), gapl);
if (node_id <= 0)
if (node_id < 0)
{
throw error::ReadError(
error::AffectedObject::Group,
Expand All @@ -770,7 +770,7 @@ void HDF5IOHandlerImpl::openPath(
if (!auxiliary::ends_with(path, '/'))
path += '/';
path_id = H5Gopen(node_id, path.c_str(), gapl);
if (path_id <= 0)
if (path_id < 0)
{
throw error::ReadError(
error::AffectedObject::Group,
Expand Down Expand Up @@ -1712,7 +1712,7 @@ void HDF5IOHandlerImpl::readAttribute(
std::vector<hsize_t> maxdims(ndims, 0);

status = H5Sget_simple_extent_dims(attr_space, dims.data(), maxdims.data());
if (obj_id < 0)
if (status != ndims)
{
throw error::ReadError(
error::AffectedObject::Attribute,
Expand Down

0 comments on commit 4e2719e

Please sign in to comment.