diff --git a/project/src/generators/BotGenerator.ts b/project/src/generators/BotGenerator.ts index 8acde807..152b03c3 100644 --- a/project/src/generators/BotGenerator.ts +++ b/project/src/generators/BotGenerator.ts @@ -318,7 +318,7 @@ export class BotGenerator */ protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[] { - if (Object.keys(skills).length === 0) + if (Object.keys(skills ?? []).length === 0) { return; } diff --git a/project/src/generators/BotInventoryGenerator.ts b/project/src/generators/BotInventoryGenerator.ts index 576e0eea..03191485 100644 --- a/project/src/generators/BotInventoryGenerator.ts +++ b/project/src/generators/BotInventoryGenerator.ts @@ -258,7 +258,7 @@ export class BotInventoryGenerator protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record { const modPool = this.botEquipmentModPoolService.getModsForGearSlot(itemTpl); - for (const modSlot of Object.keys(modPool)) + for (const modSlot of Object.keys(modPool ?? [])) { const blacklistedMods = equipmentBlacklist[0].equipment[modSlot] || []; const filteredMods = modPool[modSlot].filter(x => !blacklistedMods.includes(x));