mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-12 13:10:43 -05:00
Added empty array check to FenceService.addItemAssorts
This commit is contained in:
parent
423daf3ed0
commit
e5ab5c35a8
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user