Add nullguard to updateFuel() when generator slot has no items array

This commit is contained in:
Dev 2024-01-29 16:40:58 +00:00
parent 099e2cd6f3
commit bf7e214b77

View File

@ -433,7 +433,13 @@ export class HideoutHelper
for (let i = 0; i < generatorArea.slots.length; i++)
{
const fuelItemInSlot = generatorArea.slots[i].item[0];
if (!generatorArea.slots[i]?.item)
{
// No item in slot, skip
continue;
}
const fuelItemInSlot = generatorArea.slots[i]?.item[0];
if (!fuelItemInSlot)
{
// No item in slot, skip