From af132cc523a29ece8ddff2c5f89bb4b825618f0b Mon Sep 17 00:00:00 2001 From: kabou Date: Mon, 21 Feb 2022 17:01:37 +0100 Subject: [PATCH] Reinstate nil check in on_place_bucket. * Oops, nil checks on registered_node[name] were erroneously optimized away, risking crashes. Reinstate those checks. --- mods/ITEMS/mcl_buckets/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index e253a342a8..ff0b866dab 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -169,7 +169,7 @@ local function on_place_bucket(itemstack, user, pointed_thing, def) local undernode = get_node(pointed_thing.under) local abovenode = get_node(pointed_thing.above) - if registered_nodes[undernode.name].buildable_to or get_item_group(undernode.name, "cauldron") == 1 then + if registered_nodes[undernode.name] and registered_nodes[undernode.name].buildable_to or get_item_group(undernode.name, "cauldron") == 1 then local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.under, user) if result then local node_place = get_node_place(def.source_place, pointed_thing.under) @@ -190,7 +190,7 @@ local function on_place_bucket(itemstack, user, pointed_thing, def) end end return get_bucket_drop(itemstack, user, take_bucket) - elseif registered_nodes[abovenode.name].buildable_to or get_item_group(abovenode.name, "cauldron") == 1 then + elseif registered_nodes[abovenode.name] and registered_nodes[abovenode.name].buildable_to or get_item_group(abovenode.name, "cauldron") == 1 then local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.above, user) if result then local node_place = get_node_place(def.source_place, pointed_thing.above)