summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 21c3390..872d3fe 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -224,6 +224,10 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type,
assert(type);
assert(space);
+ /* Check if the dataspace has an extent set (or is NULL) */
+ if( !(H5S_has_extent(space)) )
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace extent has not been set")
+
/* Build the attribute information */
if((attr = H5MM_calloc(sizeof(H5A_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for attribute info")