diff options
Diffstat (limited to 'lib/internal/crypto/hash.js')
-rw-r--r-- | lib/internal/crypto/hash.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 667624dce0..38b125e5f2 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -36,7 +36,8 @@ function Hash(algorithm, options) { if (!(this instanceof Hash)) return new Hash(algorithm, options); validateString(algorithm, 'algorithm'); - const xofLen = typeof options === 'object' ? options.outputLength : undefined; + const xofLen = typeof options === 'object' && options !== null ? + options.outputLength : undefined; if (xofLen !== undefined) validateUint32(xofLen, 'options.outputLength'); this[kHandle] = new _Hash(algorithm, xofLen); |