From ee8b0e701e64916b280d8da6b01125d28b550e60 Mon Sep 17 00:00:00 2001 From: KJ7ICE <85096517+kj7ice@users.noreply.github.com> Date: Fri, 24 Jun 2022 01:42:41 -0700 Subject: [PATCH] Handle case of empty meshes list for SQL query. Fixes Ylianst#4157 --- db.js | 1 + 1 file changed, 1 insertion(+) diff --git a/db.js b/db.js index b4939f5d..62c94c33 100644 --- a/db.js +++ b/db.js @@ -1370,6 +1370,7 @@ module.exports.CreateDB = function (parent, func) { 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)); }); } else { + if ((meshes == null) || (meshes.length == 0)) { meshes = ''; } 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)); }); } else {