Skip to content

Commit

Permalink
Take into account that attach_dimscales can fail when dimensions and …
Browse files Browse the repository at this point in the history
…variables are named inconsistently (Unidata#2962)
  • Loading branch information
Alexander-Barth committed Aug 8, 2024
1 parent a200e8f commit 99ba37b
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 99ba37b

Please sign in to comment.