Skip to content

Commit de598e8

Browse files
committed
fix(NODE-5548): check for typeof string insteady of truthiness
1 parent f5130fe commit de598e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongo_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
438438
options.ca ??= await fs.readFile(options.tlsCAFile, { encoding: 'utf8' });
439439
}
440440
if (typeof options.tlsCertificateKeyFile === 'string') {
441-
if (!options.key || !options.cert) {
441+
if (typeof options.key !== 'string' || typeof options.cert !== 'string') {
442442
const contents = await fs.readFile(options.tlsCertificateKeyFile, { encoding: 'utf8' });
443443
options.key ??= contents;
444444
options.cert ??= contents;

0 commit comments

Comments
 (0)