0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 15:50:42 -05:00

Added empty array check to FenceService.addItemAssorts

This commit is contained in:
Chomp 2024-12-20 23:10:06 +00:00
parent 423daf3ed0
commit e5ab5c35a8

View File

@ -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);