From e7f5db9f0a7c4f0d0382d543ef49720a85bc83b9 Mon Sep 17 00:00:00 2001 From: Chomp Date: Fri, 6 Dec 2024 16:49:39 +0000 Subject: [PATCH] Fixed `generateUniqueBotNickname()` failing when no data is passed into its optional parameter --- project/src/services/BotNameService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/services/BotNameService.ts b/project/src/services/BotNameService.ts index e79c458e..a3af1b62 100644 --- a/project/src/services/BotNameService.ts +++ b/project/src/services/BotNameService.ts @@ -61,7 +61,7 @@ export class BotNameService { const isPlayerScav = botGenerationDetails.isPlayerScav; const simulateScavName = isPlayerScav ? false : this.shouldSimulatePlayerScavName(botRole); const showTypeInNickname = this.botConfig.showTypeInNickname && !isPlayerScav; - const roleShouldBeUnique = uniqueRoles.includes(botRole.toLowerCase()); + const roleShouldBeUnique = uniqueRoles?.includes(botRole.toLowerCase()); let isUnique = true; let attempts = 0;