From 50c441bee5a4744ab68d25037d341fe73196177c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 7 Jul 2020 21:47:51 +0100 Subject: [PATCH] missing null/undefined checks --- functions/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/index.js b/functions/index.js index 697618c54..3a4944847 100644 --- a/functions/index.js +++ b/functions/index.js @@ -372,7 +372,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" && + userdata.discordId !== null && + userdata.discordId !== undefined + ) { let besttime60 = 0; try { userdata.personalBests.time[60].forEach((result) => {