@@ -114,18 +114,18 @@ function performInitialHandshake(conn, options, _callback) {
114
114
const start = new Date ( ) . getTime ( ) ;
115
115
runCommand ( conn , 'admin.$cmd' , handshakeDoc , options , ( err , ismaster ) => {
116
116
if ( err ) {
117
- callback ( err , null ) ;
117
+ callback ( err ) ;
118
118
return ;
119
119
}
120
120
121
121
if ( ismaster . ok === 0 ) {
122
- callback ( new MongoError ( ismaster ) , null ) ;
122
+ callback ( new MongoError ( ismaster ) ) ;
123
123
return ;
124
124
}
125
125
126
126
const supportedServerErr = checkSupportedServer ( ismaster , options ) ;
127
127
if ( supportedServerErr ) {
128
- callback ( supportedServerErr , null ) ;
128
+ callback ( supportedServerErr ) ;
129
129
return ;
130
130
}
131
131
@@ -159,7 +159,7 @@ function performInitialHandshake(conn, options, _callback) {
159
159
return ;
160
160
}
161
161
162
- callback ( null , conn ) ;
162
+ callback ( undefined , conn ) ;
163
163
} ) ;
164
164
}
165
165
@@ -350,7 +350,7 @@ function runCommand(conn, ns, command, options, callback) {
350
350
// ignore all future errors
351
351
conn . on ( 'error' , noop ) ;
352
352
353
- _callback ( err , null ) ;
353
+ _callback ( err ) ;
354
354
}
355
355
356
356
function messageHandler ( msg ) {
@@ -363,7 +363,7 @@ function runCommand(conn, ns, command, options, callback) {
363
363
conn . removeListener ( 'message' , messageHandler ) ;
364
364
365
365
msg . parse ( { promoteValues : true } ) ;
366
- _callback ( null , msg . documents [ 0 ] ) ;
366
+ _callback ( undefined , msg . documents [ 0 ] ) ;
367
367
}
368
368
369
369
conn . setSocketTimeout ( socketTimeout ) ;
@@ -382,7 +382,7 @@ function authenticate(conn, credentials, callback) {
382
382
const provider = AUTH_PROVIDERS [ mechanism ] ;
383
383
provider . auth ( runCommand , [ conn ] , credentials , err => {
384
384
if ( err ) return callback ( err ) ;
385
- callback ( null , conn ) ;
385
+ callback ( undefined , conn ) ;
386
386
} ) ;
387
387
}
388
388
0 commit comments