Skip to content

Commit 350f62d

Browse files
danielmbrasiladuh95
authored andcommitted
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: #57141 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Daniel Lemire <daniel@lemire.me>
1 parent a089810 commit 350f62d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_url.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void BindingData::PathToFileURL(const FunctionCallbackInfo<Value>& args) {
161161
ada::parse<ada::url_aggregator>(EncodePathChars(input_str, os), nullptr);
162162

163163
if (!out) {
164-
return ThrowInvalidURL(realm->env(), input.ToStringView(), nullptr);
164+
return ThrowInvalidURL(realm->env(), input.ToStringView(), std::nullopt);
165165
}
166166

167167
if (os == OS::WINDOWS && args.Length() > 2 && !args[2]->IsUndefined())

0 commit comments

Comments
 (0)