Skip to content

Commit

Permalink
Merge pull request #2968 from Alexander-Barth/main
Browse files Browse the repository at this point in the history
Take into account that attach_dimscales can fail when dimensions and variables are named inconsistently
  • Loading branch information
WardF authored Aug 19, 2024
2 parents d73521c + 99ba37b commit 1db9ffb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libhdf5/nc4hdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,9 @@ attach_dimscales(NC_GRP_INFO_T *grp)
dsid = ((NC_HDF5_VAR_INFO_T *)(var->dim[d]->coord_var->format_var_info))->hdf_datasetid;
else
dsid = ((NC_HDF5_DIM_INFO_T *)var->dim[d]->format_dim_info)->hdf_dimscaleid;
assert(dsid > 0);

if (dsid <= 0)
return NC_EDIMSCALE;

/* Attach the scale. */
if (H5DSattach_scale(hdf5_var->hdf_datasetid, dsid, d) < 0)
Expand Down

0 comments on commit 1db9ffb

Please sign in to comment.