Skip to content

Commit

Permalink
src: replace to CHECK_NOT_NULL in node_crypto
Browse files Browse the repository at this point in the history
PR-URL: #33383
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Masashi Hirano <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
himself65 authored and codebytere committed Jun 7, 2020
1 parent ca4c3e0 commit 1ca6f28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,7 @@ ByteSource ByteSource::NullTerminatedCopy(Environment* env,
ByteSource ByteSource::FromSymmetricKeyObject(Local<Value> handle) {
CHECK(handle->IsObject());
KeyObject* key = Unwrap<KeyObject>(handle.As<Object>());
CHECK(key);
CHECK_NOT_NULL(key);
return Foreign(key->GetSymmetricKey(), key->GetSymmetricKeySize());
}

Expand Down Expand Up @@ -3109,7 +3109,7 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs(
} else {
CHECK(args[*offset]->IsObject());
KeyObject* key = Unwrap<KeyObject>(args[*offset].As<Object>());
CHECK(key);
CHECK_NOT_NULL(key);
CHECK_NE(key->GetKeyType(), kKeyTypeSecret);
(*offset) += 4;
return key->GetAsymmetricKey();
Expand Down Expand Up @@ -3251,7 +3251,7 @@ MaybeLocal<Object> KeyObject::Create(Environment* env,
}

KeyObject* key = Unwrap<KeyObject>(obj);
CHECK(key);
CHECK_NOT_NULL(key);
if (key_type == kKeyTypePublic)
key->InitPublic(pkey);
else
Expand Down

0 comments on commit 1ca6f28

Please sign in to comment.