diff --git a/index.js b/index.js index 0827043e..84236fc6 100644 --- a/index.js +++ b/index.js @@ -145,6 +145,9 @@ Cursor.prototype.end = function(cb) { } Cursor.prototype.close = function(cb) { + if (this.state == 'done') { + return setImmediate(cb) + } this.connection.close({type: 'P'}) this.connection.sync() this.state = 'done'