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 RafaelGSS committed 2025-05-02 17:04:35 -03:00
1 parent 87c4775dd0
commit 2ce352437f
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())