summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/H5I.c b/src/H5I.c
index ff3b6c6..54026e9 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -710,7 +710,9 @@ H5I_get_type(hid_t id)
* Programmer:
*
* Modifications:
- *
+ * Robb Matzke, 1999-08-23
+ * Also fails if the ID has a valid group but no longer exists
+ * in the ID tables.
*-------------------------------------------------------------------------
*/
H5I_type_t
@@ -723,7 +725,8 @@ H5Iget_type(hid_t id)
ret_value = H5I_get_type(id);
- if (ret_value <= H5I_BADID || ret_value >= H5I_NGROUPS) {
+ if (ret_value <= H5I_BADID || ret_value >= H5I_NGROUPS ||
+ NULL==H5I_object(id)) {
HGOTO_DONE(H5I_BADID);
}