Skip to content

Commit c492a27

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 9a52cd9 commit c492a27

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
@@ -268,10 +268,10 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
268268
Local<Object> options = args[0].As<Object>();
269269
MaybeLocal<Value> maybe_encoding = options->Get(env->context(),
270270
env->encoding_string());
271-
if (maybe_encoding.IsEmpty())
272-
return;
271+
Local<Value> encoding_opt;
272+
if (!maybe_encoding.ToLocal(&encoding_opt))
273+
return;
273274

274-
Local<Value> encoding_opt = maybe_encoding.ToLocalChecked();
275275
encoding = ParseEncoding(env->isolate(), encoding_opt, UTF8);
276276
} else {
277277
encoding = UTF8;

0 commit comments

Comments
 (0)