diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 4cccc6eb7a4772..2e3280f313db3a 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2168,7 +2168,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);