Skip to content

Commit 48244b6

Browse files
committed
fix(NODE-4831): check for null
1 parent eedc66f commit 48244b6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/cmap/connection.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,7 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
384384
} else {
385385
// Get the first orphaned operation description.
386386
const entry = this[kQueue].entries().next();
387-
/* eslint no-restricted-syntax: 0 */
388-
if (entry.value !== undefined) {
387+
if (entry.value != null) {
389388
const [requestId, orphaned]: [number, OperationDescription] = entry.value;
390389
// If the orphaned operation description exists then set it.
391390
operationDescription = orphaned;

test/unit/cmap/connection.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ describe('new Connection()', function () {
311311
const message = new BinMsg(msg, msgHeader, msgBody);
312312
expect(() => {
313313
connection.onMessage(message);
314-
}).to.not.throw(/undefined is not iterable/);
314+
}).to.not.throw();
315315
});
316316
});
317317

0 commit comments

Comments
 (0)