Beds: Do not crash when placing in an unknown node
authorSmallJoker <mk939@ymail.com>
Thu, 10 Aug 2017 07:52:53 +0000 (09:52 +0200)
committersfan5 <sfan5@live.de>
Sun, 19 Nov 2017 22:03:38 +0000 (23:03 +0100)
mods/beds/api.lua

index 97dde43dfabe9bc10c408ee8ec6a6dac35816e83..3632dc0cd3a465cbbbe3808a99e0490c2000ab17 100644 (file)
@@ -55,7 +55,7 @@ function beds.register_bed(name, def)
                        end
 
                        local pos
-                       if minetest.registered_items[minetest.get_node(under).name].buildable_to then
+                       if udef and udef.buildable_to then
                                pos = under
                        else
                                pos = pointed_thing.above