Skip to content

Commit

Permalink
Update connection.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hustxiaoc authored Dec 17, 2021
1 parent c4d7c9e commit f361220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ Connection.prototype.setClient = function setClient(client) {
if (!(client instanceof mongodb.MongoClient)) {
throw new MongooseError('Must call `setClient()` with an instance of MongoClient');
}
if (this.client != null || this.readyState !== STATES.disconnected) {
if (this.readyState !== STATES.disconnected) {
throw new MongooseError('Cannot call `setClient()` on a connection that is already connected.');
}
if (client.topology == null) {
Expand Down

0 comments on commit f361220

Please sign in to comment.