summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'load.c')
-rw-r--r--load.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/load.c b/load.c
index 62e2cac4c6..73a6eb66af 100644
--- a/load.c
+++ b/load.c
@@ -705,7 +705,11 @@ rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
static VALUE
rb_mod_autoload_p(VALUE mod, VALUE sym)
{
- return rb_autoload_p(mod, rb_to_id(sym));
+ ID id = rb_check_id(&sym);
+ if (!id) {
+ return Qnil;
+ }
+ return rb_autoload_p(mod, id);
}
/*