From 1ca6f288936a66a663ea276912eab9324f1c8cfa 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 9e3c63b5ec9245..f08d68d6b6e630 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2903,7 +2903,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()); } @@ -3109,7 +3109,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(); @@ -3251,7 +3251,7 @@ MaybeLocal KeyObject::Create(Environment* env, } KeyObject* key = Unwrap(obj); - CHECK(key); + CHECK_NOT_NULL(key); if (key_type == kKeyTypePublic) key->InitPublic(pkey); else