From 8befc3245351a6fcf4bc54bb1292a3b1cdebcbcd Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Sat, 11 Nov 2023 21:57:59 -0500 Subject: [PATCH] Trying a different way of handling the rows variable --- utilities/sqlutil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/sqlutil.js b/utilities/sqlutil.js index da144e6..77fc8db 100644 --- a/utilities/sqlutil.js +++ b/utilities/sqlutil.js @@ -125,7 +125,7 @@ async function registerChannel(channel_snowflake, server_snowflake, channel_name async function registerChannelIfMissing(channel_snowflake, server_snowflake, channel_name) { return connection_pool.query("SELECT * FROM channels WHERE channel_snowflake = ?;", [channel_snowflake]).then(async ([rows, fields]) => { - if (rows) { + if (rows.length == 0) { console.log("Channel Already Registered") return true } else {