Skip to content

Commit

Permalink
src: fix ThrowInvalidURL call in PathToFileURL
Browse files Browse the repository at this point in the history
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: #57141
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Daniel Lemire <[email protected]>
  • Loading branch information
danielmbrasil authored Feb 26, 2025
1 parent 34ded4d commit fd45383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit fd45383

Please sign in to comment.