mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
src: fix ThrowInvalidURL call in PathToFileURL
Replace `nullptr` with `std::nullopt` when calling `ThrowInvalidURL` in `PathToFileURL`. This ensures the function receives the correct argument type and aligns with the expected behavior. PR-URL: https://github.com/nodejs/node/pull/57141 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Daniel Lemire <daniel@lemire.me>
This commit is contained in:
1 parent
87c4775dd0
commit
2ce352437f
1 file changed
+1
-1
+1
-1
@@ -161,7 +161,7 @@ void BindingData::PathToFileURL(const FunctionCallbackInfo<Value>& args) {
|
||||
ada::parse<ada::url_aggregator>(EncodePathChars(input_str, os), nullptr);
|
||||
|
||||
if (!out) {
|
||||
return ThrowInvalidURL(realm->env(), input.ToStringView(), nullptr);
|
||||
return ThrowInvalidURL(realm->env(), input.ToStringView(), std::nullopt);
|
||||
}
|
||||
|
||||
if (os == OS::WINDOWS && args.Length() > 2 && !args[2]->IsUndefined())
|
||||
|
||||
Reference in new issue
Block a user