From 702755b99e8ba94faaeb2a4743e5563dfbefa058 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 15 Mar 2019 00:10:07 +0100 Subject: [PATCH] Fix crash in mcl_dye when converting unicolor --- mods/ITEMS/mcl_dye/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 90e98ac4ac..e90f518753 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -93,7 +93,12 @@ end -- Takes an unicolor group name (e.g. “unicolor_white”) and returns a corresponding dye name (if it exists), nil otherwise. mcl_dye.unicolor_to_dye = function(unicolor_group) - return "mcl_dye:" .. dyelocal.unicolor_to_dye_id[unicolor_group] + local color = dyelocal.unicolor_to_dye_id[unicolor_group] + if color then + return "mcl_dye:" .. color + else + return nil + end end -- Define items