From 844bf770f85082e806b8b93c9b77ef46b6dde3b9 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 9 Jul 2020 14:09:31 +0200 Subject: [PATCH] src: use FromMaybe instead of ToLocal in GetCert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/34276 Reviewed-By: Anna Henningsen Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- src/node_crypto_common.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc index 713e79b0c92cb3..6473b652ac9560 100644 --- a/src/node_crypto_common.cc +++ b/src/node_crypto_common.cc @@ -350,9 +350,8 @@ MaybeLocal GetCert(Environment* env, const SSLPointer& ssl) { if (cert == nullptr) return Undefined(env->isolate()); - Local ret; MaybeLocal maybe_cert = X509ToObject(env, cert); - return maybe_cert.ToLocal(&ret) ? ret : MaybeLocal(); + return maybe_cert.FromMaybe(Local()); } namespace {