Skip to content

Commit 6aca2c5

Browse files
committed
fix(cursor): close readable on null response for dead cursor
1 parent 6bb7e33 commit 6aca2c5

File tree

2 files changed

+119
-162
lines changed

2 files changed

+119
-162
lines changed

lib/cursor.js

+7
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,13 @@ Cursor.prototype._read = function() {
10811081
return self.emit('finish');
10821082
}
10831083

1084+
if (result === null && self.isDead()) {
1085+
self.close();
1086+
self.emit('end');
1087+
self.emit('finish');
1088+
return;
1089+
}
1090+
10841091
// If we provided a transformation method
10851092
if(typeof self.s.streamOptions.transform == 'function' && result != null) {
10861093
return self.push(self.s.streamOptions.transform(result));

0 commit comments

Comments
 (0)