Fix nil inv bug

This should in theory fix the bug caused by other mobs or nodes punching a drawer.
This commit is contained in:
isaiah658 2019-05-05 07:21:46 -05:00 committed by Linus Jahn (LNJ)
parent d972c830fc
commit 8fd4be6567

@ -180,6 +180,9 @@ core.register_entity("drawers:visual", {
return
end
local inv = puncher:get_inventory()
if inv == nil then
return
end
local spaceChecker = ItemStack(self.itemName)
if add_stack then
spaceChecker:set_count(spaceChecker:get_stack_max())