summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 9f7277e6b2..6f67984cf2 100644
--- a/struct.c
+++ b/struct.c
@@ -48,7 +48,7 @@ struct_ivar_get(VALUE c, ID id)
for (;;) {
c = rb_class_superclass(c);
- if (c == 0 || c == rb_cStruct || c == rb_cData || c == Qnil)
+ if (c == rb_cStruct || c == rb_cData || !RTEST(c))
return Qnil;
RUBY_ASSERT(RB_TYPE_P(c, T_CLASS));
ivar = rb_attr_get(c, id);