From 2ce352437f7740ce6cabb944628dd79668eebd4b Mon Sep 17 00:00:00 2001 From: Daniel M Brasil Date: Wed, 26 Feb 2025 11:34:50 -0300 Subject: [PATCH] src: fix ThrowInvalidURL call in PathToFileURL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Juan José Arboleda Reviewed-By: Daniel Lemire --- src/node_url.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_url.cc b/src/node_url.cc index e8b3b2cecc7..ba9bd3f9b45 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -161,7 +161,7 @@ void BindingData::PathToFileURL(const FunctionCallbackInfo& args) { ada::parse(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())