Skip to content
Snippets Groups Projects
Commit cf0e49fb authored by SmallJoker's avatar SmallJoker Committed by Paramat
Browse files

Chests: Fix crash on empty key metadata

parent 382e2acd
Branches
No related tags found
No related merge requests found
......@@ -147,6 +147,10 @@ function default.chest.register_chest(name, d)
local itemstack = player:get_wielded_item()
local key_meta = itemstack:get_meta()
if itemstack:get_metadata() == "" then
return
end
if key_meta:get_string("secret") == "" then
key_meta:set_string("secret", minetest.parse_json(itemstack:get_metadata()).secret)
itemstack:set_metadata("")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment