mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
add null check
This commit is contained in:
@@ -250,6 +250,10 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
|
||||
}
|
||||
}
|
||||
|
||||
if (home == NULL) {
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
if (!mrb_file_is_absolute_path(home)) {
|
||||
if (argc && strlen(cuser) > 0) {
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "non-absolute home of ~%s", cuser);
|
||||
|
||||
Reference in New Issue
Block a user