fix(turtle-utils): refuelWithBuffer check if fuelSlot is nil

This commit is contained in:
Guillaume ARM 2024-05-19 23:51:20 +02:00
parent 799d1654c2
commit ea4f132f2e

View File

@ -320,7 +320,11 @@ turtleUtils.refuelWithBuffer = function(sideFuel, sideBuffer, minFuelNeeded, sle
local ok, errMessage = turtleUtils.refuel(minFuelNeeded, function()
local fuelSlot = findFuelSlot(fuelInventory)
fuelInventory.pushItems(peripheral.getName(bufferInventory), fuelSlot)
if fuelSlot ~= nil then
fuelInventory.pushItems(peripheral.getName(bufferInventory), fuelSlot)
end
return suckFn()
end, sleepTime)