mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
String#[] should reject nil index
This commit is contained in:
@@ -781,6 +781,7 @@ num_index:
|
||||
}
|
||||
}
|
||||
default:
|
||||
if (mrb_nil_p(indx)) mrb_raise(mrb, E_TYPE_ERROR, "can't convert nil into Integer");
|
||||
idx = mrb_fixnum(indx);
|
||||
goto num_index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user