mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-random: Random#rand(nil) should raise TypeError
This commit is contained in:
@@ -194,7 +194,7 @@ static mrb_value
|
||||
random_rand_impl(mrb_state *mrb, rand_state *t, mrb_value self)
|
||||
{
|
||||
mrb_value arg;
|
||||
if (!mrb_get_args(mrb, "|o", &arg) || mrb_nil_p(arg)) {
|
||||
if (mrb_get_args(mrb, "|o", &arg) == 0) {
|
||||
return random_rand(mrb, t, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user