We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14bf41b commit ea221acCopy full SHA for ea221ac
config/db-function.js
@@ -5,7 +5,7 @@ function connectionCheck() {
5
return new Promise((resolve,reject) => {
6
db.getConnection(function(err, connection) {
7
if(err) {
8
- connection.release();
+ if(connection) connection.release();
9
reject(err)
10
} else {
11
resolve('success')
@@ -23,4 +23,4 @@ function connectionRelease() {
23
module.exports = {
24
connectionCheck:connectionCheck(),
25
connectionRelease:connectionRelease()
26
-}
+}
0 commit comments