summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 121ddc6432..f6c3a43f80 100644
--- a/ruby.c
+++ b/ruby.c
@@ -455,7 +455,7 @@ require_libraries(struct cmdline_options *opt)
ID require = rb_intern("require");
Init_ext(); /* should be called here for some reason :-( */
- while (RARRAY_LEN(list)) {
+ while (list && RARRAY_LEN(list) > 0) {
VALUE feature = rb_ary_shift(list);
rb_funcall2(rb_vm_top_self(), require, 1, &feature);
}