Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed Connection#close() without callback

we need a noop dep
  • Loading branch information...
commit 116b5dcae746c8934d30b68586b1c041dc79157b 1 parent f0372f8
@tj tj authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/mongoose/connection.js
View
7 lib/mongoose/connection.js
@@ -236,7 +236,8 @@ Connection.prototype.onOpen = function () {
*/
Connection.prototype.close = function (callback) {
- var self = this;
+ var self = this
+ , callback = callback || function(){};
switch (this.readyState){
case 0: // disconnected
@@ -247,10 +248,10 @@ Connection.prototype.close = function (callback) {
this.readyState = 3;
this.doClose(function(err){
if (err){
- if (callback) callback(err);
+ callback(err);
} else {
self.onClose();
- if (callback) callback(null);
+ callback(null);
}
});
break;
Please sign in to comment.
Something went wrong with that request. Please try again.