diff --git a/mods/ITEMS/mcl_bamboo/bamboo_base.lua b/mods/ITEMS/mcl_bamboo/bamboo_base.lua index 4ccb9bb1b..2cc8b23c8 100644 --- a/mods/ITEMS/mcl_bamboo/bamboo_base.lua +++ b/mods/ITEMS/mcl_bamboo/bamboo_base.lua @@ -86,7 +86,7 @@ local bamboo_def = { on_rotate = on_rotate, on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then + if pointed_thing and pointed_thing.type ~= "node" then -- make sure that pointed_thing is not null and is pointing at a node. return itemstack end local node = minetest.get_node(pointed_thing.under) @@ -277,6 +277,10 @@ local bamboo_block_def = { _mcl_stripped_variant = "mcl_bamboo:bamboo_block_stripped", -- this allows us to use the built in Axe's strip block. on_place = function(itemstack, placer, pointed_thing) + if not pointed_thing then -- make sure that pointed_thing is not null + return itemstack + end + local pos = pointed_thing.under if mcl_bamboo.is_protected(pos, placer) then