diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index b999c7332941c5..64add601e74f84 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -998,13 +998,12 @@ function Server(options, listener) { } const enableTrace = options.enableTrace; - if (enableTrace === true) - this[kEnableTrace] = true; - else if (enableTrace === false || enableTrace == null) - ; // Tracing explicitly disabled, or defaulting to disabled. - else + if (typeof enableTrace === 'boolean') { + this[kEnableTrace] = enableTrace; + } else if (enableTrace != null) { throw new ERR_INVALID_ARG_TYPE( 'options.enableTrace', 'boolean', enableTrace); + } } Object.setPrototypeOf(Server.prototype, net.Server.prototype);