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:
Daniel M Brasil authored and Antoine du Hamel committed 2025-03-09 10:58:26 +01:00
1 parent a08981025a
commit 350f62de6c
1 file changed
+1 -1
+1 -1
View File
@@ -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())