Skip to content

Commit b1c9f75

Browse files
wenningpluscodebytere
wenningplus
authored andcommitted
src: use ToLocal in node_os.cc
PR-URL: #33939 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 153f292 commit b1c9f75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_os.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
273273
Local<Object> options = args[0].As<Object>();
274274
MaybeLocal<Value> maybe_encoding = options->Get(env->context(),
275275
env->encoding_string());
276-
if (maybe_encoding.IsEmpty())
277-
return;
276+
Local<Value> encoding_opt;
277+
if (!maybe_encoding.ToLocal(&encoding_opt))
278+
return;
278279

279-
Local<Value> encoding_opt = maybe_encoding.ToLocalChecked();
280280
encoding = ParseEncoding(env->isolate(), encoding_opt, UTF8);
281281
} else {
282282
encoding = UTF8;

0 commit comments

Comments
 (0)