Skip to content

Commit 0677840

Browse files
committed
fix(NODE-4429): check for null topology
1 parent c79802b commit 0677840

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mongo_client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
501501

502502
Promise.all(activeSessionEnds)
503503
.then(() => {
504+
if (this.topology == null) {
505+
return;
506+
}
504507
// If we would attempt to select a server and get nothing back we short circuit
505508
// to avoid the server selection timeout.
506509
const selector = readPreferenceServerSelector(ReadPreference.primaryPreferred);

0 commit comments

Comments
 (0)