Commit 99ea42fe authored by Graham, Aaron's avatar Graham, Aaron
Browse files

Fix bug in has_attribute

parent 33b04d42
Pipeline #164022 passed with stage
in 2 minutes and 10 seconds
......@@ -7130,7 +7130,9 @@ FUNCTION has_attribute(this,obj_name,attr_name) RESULT(hasAttribute)
hasAttribute=.FALSE.
ENDIF
CALL close_attribute(this,attr_id)
IF(hasAttribute) THEN
CALL close_attribute(this,attr_id)
ENDIF
CALL close_object(this,obj_id)
#endif
......@@ -7524,7 +7526,7 @@ SUBROUTINE open_object(this,obj_name,obj_id,ioerror)
CALL h5lexists_f(this%file_id,path,dset_exists,error)
IF(.NOT. dset_exists) THEN
IF(PRESENT(ioerror)) THEN
ioerror=error
ioerror=-1
ELSE
CALL this%e%raiseError(modName//'::'//myName//' - Incorrect path to object.')
ENDIF
......@@ -7557,7 +7559,7 @@ SUBROUTINE close_attribute(this,attr_id)
CALL h5aclose_f(attr_id,error)
IF (error /= 0) THEN
CALL this%e%raiseError(modName//'::'//myName// &
' - Failed to close objectt.')
' - Failed to close attribute.')
RETURN
ENDIF
ENDSUBROUTINE close_attribute
......@@ -7576,7 +7578,7 @@ SUBROUTINE close_object(this,obj_id)
CALL h5Oclose_f(obj_id,error)
IF (error /= 0) THEN
CALL this%e%raiseError(modName//'::'//myName// &
' - Failed to close objectt.')
' - Failed to close object.')
RETURN
ENDIF
ENDSUBROUTINE close_object
......@@ -7609,7 +7611,7 @@ SUBROUTINE open_attribute(this,obj_id,attr_name,attr_id,ioerror)
CALL h5aexists_f(obj_id,attr_name,attr_exists,error)
IF (.NOT. attr_exists) THEN
IF(PRESENT(ioerror)) THEN
ioerror=error
ioerror=-1
ELSE
CALL this%e%raiseError(modName//'::'//myName//' - Attribute does not exist for object.')
ENDIF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment