Skip to content

Commit 45c5650

Browse files
committed
Make sure we have a connection before disconnecting
1 parent c062370 commit 45c5650

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ Modulestore.prototype.detachConnection = function () {
6969
};
7070

7171
Modulestore.prototype.disconnect = function () {
72-
return this.connection.closeAsync();
72+
if (this.connection) {
73+
return this.connection.closeAsync();
74+
}
7375
};
7476

7577
Modulestore.prototype.listCourses = function (filter, options) {

0 commit comments

Comments
 (0)