Skip to content

Commit 4e2719e

Browse files
Fix some error conditions in HDF5 backend
1 parent 1985a70 commit 4e2719e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/IO/HDF5/HDF5IOHandler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ void HDF5IOHandlerImpl::openPath(
751751

752752
node_id = H5Gopen(
753753
file.id, concrete_h5_file_position(writable->parent).c_str(), gapl);
754-
if (node_id <= 0)
754+
if (node_id < 0)
755755
{
756756
throw error::ReadError(
757757
error::AffectedObject::Group,
@@ -770,7 +770,7 @@ void HDF5IOHandlerImpl::openPath(
770770
if (!auxiliary::ends_with(path, '/'))
771771
path += '/';
772772
path_id = H5Gopen(node_id, path.c_str(), gapl);
773-
if (path_id <= 0)
773+
if (path_id < 0)
774774
{
775775
throw error::ReadError(
776776
error::AffectedObject::Group,
@@ -1712,7 +1712,7 @@ void HDF5IOHandlerImpl::readAttribute(
17121712
std::vector<hsize_t> maxdims(ndims, 0);
17131713

17141714
status = H5Sget_simple_extent_dims(attr_space, dims.data(), maxdims.data());
1715-
if (obj_id < 0)
1715+
if (status != ndims)
17161716
{
17171717
throw error::ReadError(
17181718
error::AffectedObject::Attribute,

0 commit comments

Comments
 (0)