Mysql fix (#886)

* Check if there is a connection before release

Fixes #885
This commit is contained in:
Ben Hardill
2022-02-21 20:08:33 +00:00
committed by GitHub
parent 5c333db0dd
commit 87e50f2b76

View File

@@ -114,7 +114,9 @@ module.exports = function(RED) {
//console.log("query:",msg.topic);
node.mydbConfig.pool.getConnection(function (err, conn) {
if (err) {
if (conn) {
conn.release()
}
status = { fill: "red", shape: "ring", text: RED._("mysql.status.error") + ": " + err.code };
node.status(status);
node.error(err, msg);