From c2bde75103db8e8c314db95868abe9767a1e6e3e Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 7 Jul 2020 19:28:09 +0100 Subject: [PATCH] made sure not to send the command to the bot if the discordid is undefined --- functions/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/index.js b/functions/index.js index 3b777346b..262f2aef0 100644 --- a/functions/index.js +++ b/functions/index.js @@ -367,7 +367,12 @@ exports.testCompleted = functions.https.onCall((request, response) => { request.obj )}` ); - if (obj.mode === "time" && String(obj.mode2) === "60") { + if ( + obj.mode === "time" && + String(obj.mode2) === "60" && + obj.discordId !== null && + obj.discordId !== undefined + ) { console.log( `sending command to the bot to update the role for user ${request.uid} with wpm ${obj.wpm}` );