From 7f9c8859a179a0ef700ac4710ba7e46bee11736a Mon Sep 17 00:00:00 2001 From: wenningplus Date: Thu, 18 Jun 2020 19:11:04 +0800 Subject: [PATCH] src: use ToLocal --- src/node_os.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_os.cc b/src/node_os.cc index bd61b4c87c0e1a..085fb1aef01c32 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -268,10 +268,10 @@ static void GetUserInfo(const FunctionCallbackInfo& args) { Local options = args[0].As(); MaybeLocal maybe_encoding = options->Get(env->context(), env->encoding_string()); - if (maybe_encoding.IsEmpty()) - return; + Local encoding_opt; + if (!maybe_encoding.ToLocal(&encoding_opt)) + return; - Local encoding_opt = maybe_encoding.ToLocalChecked(); encoding = ParseEncoding(env->isolate(), encoding_opt, UTF8); } else { encoding = UTF8;