Fix: check for empty object when looking at key length
This commit is contained in:
parent
16e1293d55
commit
5e739c2a90
@ -318,7 +318,7 @@ export class BotGenerator
|
|||||||
*/
|
*/
|
||||||
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[]
|
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[]
|
||||||
{
|
{
|
||||||
if (Object.keys(skills).length === 0)
|
if (Object.keys(skills ?? []).length === 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ export class BotInventoryGenerator
|
|||||||
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record<string, string[]>
|
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record<string, string[]>
|
||||||
{
|
{
|
||||||
const modPool = this.botEquipmentModPoolService.getModsForGearSlot(itemTpl);
|
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 blacklistedMods = equipmentBlacklist[0].equipment[modSlot] || [];
|
||||||
const filteredMods = modPool[modSlot].filter(x => !blacklistedMods.includes(x));
|
const filteredMods = modPool[modSlot].filter(x => !blacklistedMods.includes(x));
|
||||||
|
Loading…
Reference in New Issue
Block a user