Merge pull request #4171 from kj7ice/master

Handle case of empty meshes list for SQL query
This commit is contained in:
Ylian Saint-Hilaire 2022-06-24 10:14:40 -07:00 committed by GitHub
commit 1a5d1e11af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
db.js
View File

@ -1370,6 +1370,7 @@ module.exports.CreateDB = function (parent, func) {
if (id && (id != '')) { if (id && (id != '')) {
sqlDbQuery('SELECT doc FROM main WHERE id = ? AND type = ? AND domain = ? AND extra IN (?)', [id, type, domain, meshes], function (err, docs) { if (err == null) { for (var i in docs) { delete docs[i].type } } func(err, performTypedRecordDecrypt(docs)); }); sqlDbQuery('SELECT doc FROM main WHERE id = ? AND type = ? AND domain = ? AND extra IN (?)', [id, type, domain, meshes], function (err, docs) { if (err == null) { for (var i in docs) { delete docs[i].type } } func(err, performTypedRecordDecrypt(docs)); });
} else { } else {
if ((meshes == null) || (meshes.length == 0)) { meshes = ''; }
if (extrasids == null) { if (extrasids == null) {
sqlDbQuery('SELECT doc FROM main WHERE type = ? AND domain = ? AND extra IN (?)', [type, domain, meshes], function (err, docs) { if (err == null) { for (var i in docs) { delete docs[i].type } } func(err, performTypedRecordDecrypt(docs)); }); sqlDbQuery('SELECT doc FROM main WHERE type = ? AND domain = ? AND extra IN (?)', [type, domain, meshes], function (err, docs) { if (err == null) { for (var i in docs) { delete docs[i].type } } func(err, performTypedRecordDecrypt(docs)); });
} else { } else {