Skip to content

Commit

Permalink
fix: correct typeof check in checkSupportedServer (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken authored Jan 11, 2021
1 parent 2492dd2 commit 421fe6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmap/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function checkSupportedServer(ismaster: Document, options: ConnectionOptions) {
ismaster.maxWireVersion >= MIN_SUPPORTED_WIRE_VERSION;
const serverVersionLowEnough =
ismaster &&
(typeof ismaster.maxWireVersion === 'number' || ismaster.maxWireVersion instanceof Int32) &&
(typeof ismaster.minWireVersion === 'number' || ismaster.minWireVersion instanceof Int32) &&
ismaster.minWireVersion <= MAX_SUPPORTED_WIRE_VERSION;

if (serverVersionHighEnough) {
Expand Down

0 comments on commit 421fe6e

Please sign in to comment.