From 06274518bf467130ba5351faf51ef5cabf2ac363 Mon Sep 17 00:00:00 2001 From: kabou Date: Thu, 17 Feb 2022 14:23:50 +0100 Subject: [PATCH] Add player object check. * Handle the case where a mob somehow "clicks" on a composter and we get an invalid player object passed. --- mods/ITEMS/mcl_composters/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_composters/init.lua b/mods/ITEMS/mcl_composters/init.lua index 819869876a..e36d66641c 100644 --- a/mods/ITEMS/mcl_composters/init.lua +++ b/mods/ITEMS/mcl_composters/init.lua @@ -139,7 +139,7 @@ local function composter_add_item(pos, node, player, itemstack, pointed_thing) -- handle filling the composter when rightclicked -- as an on_rightclick handles, it returns an itemstack -- - if not player or player:get_player_control().sneak then + if not player or (player:get_player_control() and player:get_player_control().sneak) then return itemstack end if not itemstack and itemstack:is_empty() then