Skip to content

Commit

Permalink
Added empty array check to FenceService.addItemAssorts
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomp committed Dec 20, 2024
1 parent 423daf3 commit e5ab5c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions project/src/services/FenceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@ export class FenceService {
const assortRootItems = baseFenceAssortClone.items.filter(
(item) => item.parentId === "hideout" && !item.upd?.sptPresetId,
);
if (assortRootItems.length === 0) {
this.logger.error("Unable to add assorts to Fence as no root items exist in items being added");

return;
}

for (let i = 0; i < assortCount; i++) {
const chosenBaseAssortRoot = this.randomUtil.getArrayValue(assortRootItems);
Expand Down

0 comments on commit e5ab5c3

Please sign in to comment.