summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 8d6cd96ded..fbd82374eb 100644
--- a/hash.c
+++ b/hash.c
@@ -1685,6 +1685,7 @@ recursive_hash(VALUE hash, VALUE dummy, int recur)
if (!RHASH(hash)->ntbl)
return LONG2FIX(0);
hval = RHASH(hash)->ntbl->num_entries;
+ if (!hval) return LONG2FIX(0);
if (recur)
hval = rb_hash_uint(rb_hash_start(rb_hash(rb_cHash)), hval);
else