diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 694fa657d8b03b..4a96e95ef76625 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2164,7 +2164,8 @@ void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); Local reason_string = OneByteString(isolate, reason); Local exception_value = Exception::Error(reason_string); - Local exception_object = exception_value->ToObject(isolate); + Local exception_object = + exception_value->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); exception_object->Set(w->env()->context(), w->env()->code_string(), OneByteString(isolate, code)).FromJust(); args.GetReturnValue().Set(exception_object);