projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
382e2ac
)
Chests: Fix crash on empty key metadata
author
SmallJoker
<SmallJoker@users.noreply.github.com>
Thu, 18 Oct 2018 04:45:35 +0000
(06:45 +0200)
committer
Paramat
<paramat@users.noreply.github.com>
Thu, 18 Oct 2018 04:45:35 +0000
(
05:45
+0100)
mods/default/chests.lua
patch
|
blob
|
history
diff --git
a/mods/default/chests.lua
b/mods/default/chests.lua
index cd7079919b1b406018027bf296fb3b188f2c0211..333890564ea77a6bafacdc145e0641290018155c 100644
(file)
--- a/
mods/default/chests.lua
+++ b/
mods/default/chests.lua
@@
-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("")