From 32b356d3f1515c0b1f039023898c098241e3d786 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 5 Nov 2023 20:29:10 +0000 Subject: [PATCH] Fix `isbotPmc` `isBotBoss` and `isBotFollower` failing when undefined values are passed in --- project/src/helpers/BotHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/helpers/BotHelper.ts b/project/src/helpers/BotHelper.ts index 44194728..bdcfca4e 100644 --- a/project/src/helpers/BotHelper.ts +++ b/project/src/helpers/BotHelper.ts @@ -66,17 +66,17 @@ export class BotHelper */ public isBotPmc(botRole: string): boolean { - return (["usec", "bear", "pmc", "sptbear", "sptusec"].includes(botRole.toLowerCase())); + return (["usec", "bear", "pmc", "sptbear", "sptusec"].includes(botRole?.toLowerCase())); } public isBotBoss(botRole: string): boolean { - return this.botConfig.bosses.some(x => x.toLowerCase() === botRole.toLowerCase()); + return this.botConfig.bosses.some(x => x.toLowerCase() === botRole?.toLowerCase()); } public isBotFollower(botRole: string): boolean { - return botRole.toLowerCase().startsWith("follower"); + return botRole?.toLowerCase().startsWith("follower"); } /**