mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Chests: Fix crash on empty key metadata
This commit is contained in:
parent
382e2acd9b
commit
cf0e49fb4a
@ -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("")
|
||||
|
Loading…
Reference in New Issue
Block a user