From 8ada953ef2ae1f7fc15555154e784e6299889c03 Mon Sep 17 00:00:00 2001 From: himself65 Date: Wed, 13 May 2020 13:44:41 +0800 Subject: [PATCH] src: replace to CHECK_NOT_NULL in node_crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/33383 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Masashi Hirano Reviewed-By: Colin Ihrig Reviewed-By: Juan José Arboleda --- src/node_crypto.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index d53a6d2f2325fe..d2f67808ce9bde 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2923,7 +2923,7 @@ ByteSource ByteSource::NullTerminatedCopy(Environment* env, ByteSource ByteSource::FromSymmetricKeyObject(Local handle) { CHECK(handle->IsObject()); KeyObject* key = Unwrap(handle.As()); - CHECK(key); + CHECK_NOT_NULL(key); return Foreign(key->GetSymmetricKey(), key->GetSymmetricKeySize()); } @@ -3129,7 +3129,7 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs( } else { CHECK(args[*offset]->IsObject()); KeyObject* key = Unwrap(args[*offset].As()); - CHECK(key); + CHECK_NOT_NULL(key); CHECK_NE(key->GetKeyType(), kKeyTypeSecret); (*offset) += 4; return key->GetAsymmetricKey(); @@ -3271,7 +3271,7 @@ MaybeLocal KeyObject::Create(Environment* env, } KeyObject* key = Unwrap(obj); - CHECK(key); + CHECK_NOT_NULL(key); if (key_type == kKeyTypePublic) key->InitPublic(pkey); else