From b25342d2f5a7ec58b17eacd470f21a749f8f6b44 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 28 Jul 2023 17:11:18 +0100 Subject: [PATCH] Log error when RAID_CONFIGURATION values cannot be found inside getBotDifficulty() --- project/src/controllers/BotController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/src/controllers/BotController.ts b/project/src/controllers/BotController.ts index dd7d423d..6f34c4ad 100644 --- a/project/src/controllers/BotController.ts +++ b/project/src/controllers/BotController.ts @@ -79,7 +79,11 @@ export class BotController */ public getBotDifficulty(type: string, difficulty: string): Difficulty { - const raidConfig = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); + const raidConfig = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION)?.getValue(); + if (!raidConfig) + { + this.logger.error("applicationContex could not find RAID_CONFIGURATION value, raidConfig is undefined"); + } // Check value chosen in pre-raid difficulty dropdown // If value is not 'asonline', change requested difficulty to be what was chosen in dropdown