mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 08:01:07 +01:00
Fix crashing if null itemstack enchant when player is hacking
This commit is contained in:
parent
e0c94ccb8a
commit
cf46f0d8b8
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,9 @@ function mcl_enchanting.is_book(itemname)
|
|||
end
|
||||
|
||||
function mcl_enchanting.get_enchantments(itemstack)
|
||||
if not itemstack then
|
||||
return({})
|
||||
end
|
||||
return minetest.deserialize(itemstack:get_meta():get_string("mcl_enchanting:enchantments")) or {}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue