diff options
author | wenningplus <zhangwenning@videopls.com> | 2020-06-18 14:11:04 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-06-25 04:00:51 +0300 |
commit | 4438852aa16689b841e5ffbca4a24fc36a0fe33c (patch) | |
tree | 4f6689f98dcca342fc801cc41277e47b2ddebffd /src/node_os.cc | |
parent | 5ef5116311f5e78333dc0dbe378553e64f06cab3 (diff) |
src: use ToLocal in node_os.cc
PR-URL: https://github.com/nodejs/node/pull/33939
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_os.cc')
-rw-r--r-- | src/node_os.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_os.cc b/src/node_os.cc index bd61b4c87c0..085fb1aef01 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -268,10 +268,10 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) { Local<Object> options = args[0].As<Object>(); MaybeLocal<Value> maybe_encoding = options->Get(env->context(), env->encoding_string()); - if (maybe_encoding.IsEmpty()) - return; + Local<Value> encoding_opt; + if (!maybe_encoding.ToLocal(&encoding_opt)) + return; - Local<Value> encoding_opt = maybe_encoding.ToLocalChecked(); encoding = ParseEncoding(env->isolate(), encoding_opt, UTF8); } else { encoding = UTF8; |