From 4e2719ede094373290b07b3309f5b26ebebff9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 31 Mar 2022 16:03:45 +0200 Subject: [PATCH] Fix some error conditions in HDF5 backend --- src/IO/HDF5/HDF5IOHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/IO/HDF5/HDF5IOHandler.cpp b/src/IO/HDF5/HDF5IOHandler.cpp index 360c51cc99..3c3ec38259 100644 --- a/src/IO/HDF5/HDF5IOHandler.cpp +++ b/src/IO/HDF5/HDF5IOHandler.cpp @@ -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, @@ -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, @@ -1712,7 +1712,7 @@ void HDF5IOHandlerImpl::readAttribute( std::vector 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,