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
|
end
|
||||||
|
|
||||||
function mcl_enchanting.get_enchantments(itemstack)
|
function mcl_enchanting.get_enchantments(itemstack)
|
||||||
|
if not itemstack then
|
||||||
|
return({})
|
||||||
|
end
|
||||||
return minetest.deserialize(itemstack:get_meta():get_string("mcl_enchanting:enchantments")) or {}
|
return minetest.deserialize(itemstack:get_meta():get_string("mcl_enchanting:enchantments")) or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue