mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
iv table may be empty
This commit is contained in:
+1
-1
@@ -615,7 +615,7 @@ mrb_obj_instance_variables(mrb_state *mrb, mrb_value self)
|
||||
mrb_value ary;
|
||||
|
||||
ary = mrb_ary_new(mrb);
|
||||
if (obj_iv_p(self)) {
|
||||
if (obj_iv_p(self) && mrb_obj_ptr(self)->iv) {
|
||||
iv_foreach(mrb, mrb_obj_ptr(self)->iv, iv_i, &ary);
|
||||
}
|
||||
return ary;
|
||||
|
||||
Reference in New Issue
Block a user