diff --git a/src/node_contextify.cc b/src/node_contextify.cc index b90b369d1b379c..5d44c2f76dd7a0 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1119,14 +1119,14 @@ void ContextifyContext::CompileFunction( context_extensions.size(), context_extensions.data(), options, v8::ScriptCompiler::NoCacheReason::kNoCacheNoReason, &script); - if (maybe_fn.IsEmpty()) { + Local fn; + if (!maybe_fn.ToLocal(&fn)) { if (try_catch.HasCaught() && !try_catch.HasTerminated()) { errors::DecorateErrorStack(env, try_catch); try_catch.ReThrow(); } return; } - Local fn = maybe_fn.ToLocalChecked(); Local cache_key; if (!env->compiled_fn_entry_template()->NewInstance(