Skip to content

Commit

Permalink
fix(NODE-4429): check for null topology
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Aug 17, 2022
1 parent c79802b commit 0677840
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mongo_client.ts
Expand Up @@ -501,6 +501,9 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {

Promise.all(activeSessionEnds)
.then(() => {
if (this.topology == null) {
return;
}
// If we would attempt to select a server and get nothing back we short circuit
// to avoid the server selection timeout.
const selector = readPreferenceServerSelector(ReadPreference.primaryPreferred);
Expand Down

0 comments on commit 0677840

Please sign in to comment.