Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
crypto: remove check for condition that is always true
The value of `key` will always be `!= null` because earlier in the
function, `ERR_CRYPTO_SIGN_KEY_REQUIRED` is thrown if `key` is falsy.
Remove condition that subsequently checks that `key != null`.
  • Loading branch information
Trott committed Apr 4, 2021
commit 427d684ce0d5b3cde0255068eacbf63efc40f589
2 changes: 1 addition & 1 deletion lib/internal/crypto/sig.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function signOneShot(algorithm, data, key, callback) {
let keyData;
if (isKeyObject(key) || isCryptoKey(key)) {
({ data: keyData } = preparePrivateKey(key));
} else if (key != null && (isKeyObject(key.key) || isCryptoKey(key.key))) {
} else if (isKeyObject(key.key) || isCryptoKey(key.key)) {
({ data: keyData } = preparePrivateKey(key.key));
} else {
keyData = createPrivateKey(key)[kHandle];
Expand Down