@@ -235,11 +235,10 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
235235 uint32_t val = args[0 ].As <Uint32>()->Value ();
236236 point_conversion_form_t form = static_cast <point_conversion_form_t >(val);
237237
238- const char * error;
239238 Local<Object> buf;
240- if (! ECPointToBuffer (env, group, pub, form, &error ).ToLocal (&buf))
241- return THROW_ERR_CRYPTO_OPERATION_FAILED (env, error );
242- args. GetReturnValue (). Set (buf);
239+ if (ECPointToBuffer (env, group, pub, form).ToLocal (&buf)) {
240+ args. GetReturnValue (). Set (buf );
241+ }
243242}
244243
245244void ECDH::GetPrivateKey (const FunctionCallbackInfo<Value>& args) {
@@ -397,11 +396,10 @@ void ECDH::ConvertKey(const FunctionCallbackInfo<Value>& args) {
397396 uint32_t val = args[2 ].As <Uint32>()->Value ();
398397 point_conversion_form_t form = static_cast <point_conversion_form_t >(val);
399398
400- const char * error;
401399 Local<Object> buf;
402- if (! ECPointToBuffer (env, group, pub, form, &error ).ToLocal (&buf))
403- return THROW_ERR_CRYPTO_OPERATION_FAILED (env, error );
404- args. GetReturnValue (). Set (buf);
400+ if (ECPointToBuffer (env, group, pub, form).ToLocal (&buf)) {
401+ args. GetReturnValue (). Set (buf );
402+ }
405403}
406404
407405void ECDHBitsConfig::MemoryInfo (MemoryTracker* tracker) const {
0 commit comments