summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 557583f5aa..d1c68b58f3 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -857,6 +857,10 @@ rb_alias(VALUE klass, ID name, ID def)
{
rb_method_entry_t *orig_me;
+ if (NIL_P(klass)) {
+ rb_raise(rb_eTypeError, "no class to make alias");
+ }
+
rb_frozen_class_p(klass);
if (klass == rb_cObject) {
rb_secure(4);