CraftSim

CraftSim

2M Downloads

Lua error when crafting via TSM

KyrosKrane opened this issue ยท 3 comments

commented

Steps to reproduce:

  1. Load both TSM and CraftSim.
  2. Queue up some items with TSM using the crafting window.
  3. Craft an item using the Craft Next button.

The error will happen frequently but not every time.

7x ...ceCraftSim/Modules/CraftQueue/CraftQueue.lua:290: attempt to index local 'enchantItemTarget' (a number value)
[string "@CraftSim/Modules/CraftQueue/CraftQueue.lua"]:290: in function `OnCraftRecipe'
[string "@CraftSim/Main/CraftSim.lua"]:397: in function <CraftSim/Main/CraftSim.lua:352>
[string "=[C]"]: in function `CraftRecipe'
[string "@TradeSkillMaster/Core/Service/Crafting/ProfessionUtil.lua"]:273: in function `Craft'
[string "@TradeSkillMaster/Core/UI/CraftingUI/Crafting.lua"]:767: in function `StartCraft'
[string "@TradeSkillMaster/Core/UI/CraftingUI/Crafting.lua"]:945: in function <...Ons/TradeSkillMaster/Core/UI/CraftingUI/Crafting.lua:935>
[string "=(tail call)"]: ?
[string "@TradeSkillMaster/External/LibTSMClass-2/LibTSMClass.lua"]:332: in function <...radeSkillMaster/External/LibTSMClass/LibTSMClass.lua:319>
[string "=(tail call)"]: ?
[string "@TradeSkillMaster/External/LibTSMClass-2/LibTSMClass.lua"]:332: in function `_ProcessEvent'
[string "@TradeSkillMaster/LibTSM/Util/FSMClasses/Machine.lua"]:127: in function <.../TradeSkillMaster/LibTSM/Util/FSMClasses/Machine.lua:105>
[string "@TradeSkillMaster/External/LibTSMClass-2/LibTSMClass.lua"]:332: in function `ProcessEvent'
[string "@TradeSkillMaster/Core/UI/CraftingUI/Crafting.lua"]:541: in function `_onClickHandler'
[string "@TradeSkillMaster/Core/UI/Components/Controls/ActionButton.lua"]:333: in function <...lMaster/Core/UI/Components/Controls/ActionButton.lua:320>
[string "@TradeSkillMaster/External/LibTSMClass-2/LibTSMClass.lua"]:332: in function <...radeSkillMaster/External/LibTSMClass/LibTSMClass.lua:319>
[string "@TradeSkillMaster/External/LibTSMClass-2/LibTSMClass.lua"]:502: in function `?'
[string "@TradeSkillMaster/LibTSM/Util/ScriptWrapper.lua"]:86: in function `ScriptHandlerCommon'
[string "@TradeSkillMaster/LibTSM/Util/ScriptWrapper.lua"]:37: in function <...ddOns/TradeSkillMaster/LibTSM/Util/ScriptWrapper.lua:36>

Full error including locals: https://pastebin.com/3m0UxLzR

commented

The error is unrelated to TSM. What you are seeing is the TSM error catcher reporting the error. The error somewhere around line 397 of CraftSim.lua in the function OnCraftRecipe.

commented

I just noticed that due to a formatting error, the first line of the error message (and the most important one) was hidden. I've edited the first post. The actual error message is:
...ceCraftSim/Modules/CraftQueue/CraftQueue.lua:290: attempt to index local 'enchantItemTarget' (a number value)

commented

For the record, this is still an ongoing issue. I was able to silence the errors by changing Modules/CraftQueue/CraftQueue.lua line 317 to:

    if enchantItemTarget and type(enchantItemTarget) == "table" and enchantItemTarget.IsValid and enchantItemTarget:IsValid() then

It may not fix the underlying issue, but at least it doesn't keep throwing lua errors.