mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Prevented NRE being thrown when no weapon found inside getSealedContainerWeaponModRewards()
This commit is contained in:
parent
16f170f28e
commit
292dadc55e
@ -545,13 +545,13 @@ export class LootGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get items that fulfil reward type criteria from items that fit on gun
|
// Get items that fulfil reward type criteria from items that fit on gun
|
||||||
const relatedItems = linkedItemsToWeapon.filter(
|
const relatedItems = linkedItemsToWeapon?.filter(
|
||||||
(x) => x._parent === rewardTypeId && !this.itemFilterService.isItemBlacklisted(x._id),
|
(item) => item._parent === rewardTypeId && !this.itemFilterService.isItemBlacklisted(item._id),
|
||||||
);
|
);
|
||||||
if (!relatedItems || relatedItems.length === 0)
|
if (!relatedItems || relatedItems.length === 0)
|
||||||
{
|
{
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`No items found to fulfil reward type ${rewardTypeId} for weapon: ${chosenWeaponPreset._name}, skipping type`,
|
`No items found to fulfil reward type: ${rewardTypeId} for weapon: ${chosenWeaponPreset._name}, skipping type`,
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user