Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rb_undef() raises an TypeError when passed Qnil

  • Loading branch information...
commit e34016edef0447b975ba84827ff220b5f37542bf 1 parent 45575aa
Watson Watson1978 authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  vm_method.c
3  vm_method.c
View
@@ -142,6 +142,9 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
void
rb_undef(VALUE klass, ID id)
{
+ if (NIL_P(klass)) {
+ rb_raise(rb_eTypeError, "no class to undef method");
+ }
if (klass == rb_cObject) {
rb_secure(4);
}
Please sign in to comment.
Something went wrong with that request. Please try again.