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,
436
436
MaybeLocal<String> value_string =
437
437
env->env_vars ()->Get (env->isolate (), property.As <String>());
438
438
439
- bool has_env = !value_string.IsEmpty ();
440
439
TraceEnvVar (env, " get" , property.As <String>());
441
440
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 ;
446
444
}
447
- return Intercepted::kNo ;
445
+ info.GetReturnValue ().Set (ret);
446
+ return Intercepted::kYes ;
448
447
}
449
448
450
449
static Intercepted EnvSetter (Local<Name> property,
You can’t perform that action at this time.
0 commit comments