mruby-random: Random#rand(nil) should raise TypeError

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-05-08 17:37:05 +09:00
parent 88e86ee62e
commit 3d2f848e64
+1 -1
View File
@@ -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);
}