From cf46f0d8b88870170a0a00367601f031499f193a Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 29 Apr 2021 01:32:57 -0400 Subject: [PATCH] Fix crashing if null itemstack enchant when player is hacking --- mods/ITEMS/mcl_enchanting/engine.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index e5b61d328c..89fdc393dc 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -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