Changed section to fix nil in src/NetworkChest.lua
-- get new sorted requests
local requests = {}
for _, request in ipairs(info.requests) do
if game.item_prototypes[request.item] ~= nil then -- Fix for nil 01/06/2024
local stack_size = game.item_prototypes[request.item].stack_size
local n_slots = math.ceil(request.buffer / stack_size)
local n_max = n_slots * stack_size
local old_count = contents[request.item] or 0
local new_count = math.min(n_max, old_count)
contents[request.item] = old_count - new_count
table.insert(requests, {
item = request.item,
sort_count = new_count - request.buffer,
buffer = request.buffer,
stack_size = stack_size,
count = new_count,
n_slots = n_slots,
})
end
end
table.sort(requests, request_list_sort)