made sure not to send the command to the bot if the discordid is undefined

This commit is contained in:
Jack 2020-07-07 19:28:09 +01:00
parent 2e4761fa5e
commit c2bde75103

View file

@ -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}`
);