File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -436,15 +436,14 @@ static Intercepted EnvGetter(Local<Name> property,
436436 MaybeLocal<String> value_string =
437437 env->env_vars ()->Get (env->isolate (), property.As <String>());
438438
439- bool has_env = !value_string.IsEmpty ();
440439 TraceEnvVar (env, " get" , property.As <String>());
441440
442- if (has_env) {
443- // ToLocalChecked here is ok since we check IsEmpty above.
444- info.GetReturnValue ().Set (value_string.ToLocalChecked ());
445- return Intercepted::kYes ;
441+ Local<Value> ret;
442+ if (!value_string.ToLocal (&ret)) {
443+ return Intercepted::kNo ;
446444 }
447- return Intercepted::kNo ;
445+ info.GetReturnValue ().Set (ret);
446+ return Intercepted::kYes ;
448447}
449448
450449static Intercepted EnvSetter (Local<Name> property,
You can’t perform that action at this time.
0 commit comments