rethinkdbdash
Advanced tools
Comparing version 2.2.7 to 2.2.8
@@ -12,2 +12,3 @@ var Readable = require('stream').Readable; | ||
this._highWaterMark = options.highWaterMark; | ||
this._closed = false; | ||
@@ -45,3 +46,3 @@ Readable.call(this, { | ||
self._pending--; | ||
if (self._pending < 0) { | ||
if (self._pending < 0 || self._closed === true) { | ||
return; | ||
@@ -96,2 +97,5 @@ } | ||
var self = this; | ||
if (self._closed === true) { | ||
return; | ||
} | ||
if (self._cursor._closed === true) { | ||
@@ -102,2 +106,5 @@ self.push(null); | ||
self._cursor._next().then(function(data) { | ||
if (self._closed === true) { | ||
return; | ||
} | ||
// Silently drop null values for now | ||
@@ -143,2 +150,3 @@ if (data === null) { | ||
ReadableStream.prototype.close = function() { | ||
this._closed = true; | ||
this.push(null); | ||
@@ -145,0 +153,0 @@ return this._cursor.close(); |
{ | ||
"name": "rethinkdbdash", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "A Node.js driver for RethinkDB with promises and a connection pool", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
822259
25089