mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-12 11:37:31 +01:00
Fix crashing if null itemstack enchant when player is hacking
This commit is contained in:
parent
e0c94ccb8a
commit
cf46f0d8b8
@ -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 New Issue
Block a user