summaryrefslogtreecommitdiffstats
path: root/hl/src/H5TB.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/src/H5TB.c')
-rw-r--r--hl/src/H5TB.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 7856d5f..1ca41a8 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -982,7 +982,7 @@ herr_t H5TBread_fields_name(hid_t loc_id,
if((mem_type_id = H5Tcreate(H5T_COMPOUND, type_size)) < 0)
goto out;
- /* iterate tru the members */
+ /* iterate through the members */
for(i = 0, j = 0; i < nfields; i++) {
/* get the member name */
if(NULL == (member_name = H5Tget_member_name(ftype_id, (unsigned)i)))
@@ -1028,6 +1028,10 @@ herr_t H5TBread_fields_name(hid_t loc_id,
member_name = NULL;
} /* end for */
+ /* check to make sure field was found, no reason to continue if it does not exist */
+ if(j == 0)
+ goto out;
+
/* get the dataspace handle */
if((sid = H5Dget_space(did)) < 0)
goto out;