Skip to content

Commit

Permalink
fix: Prevent a potential crash if Core.close() is called before Core.…
Browse files Browse the repository at this point in the history
…connect()
  • Loading branch information
notheotherben committed Mar 30, 2018
1 parent 19a3436 commit 808c2e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class Core {
if (!this._connection) return this;
let conn: MongoDB.MongoClient = this._connection;
this._connection = undefined;
conn.close();
conn.close && conn.close();
return this;
}), callback);
}
Expand Down

0 comments on commit 808c2e1

Please sign in to comment.