Profession Shopping List

Profession Shopping List

421k Downloads

Fix for tooltip lua error

ayoubleborgne opened this issue ยท 6 comments

commented

If you hover over a material without having a reciped tracked you get the error

88x ...ns/ProfessionShoppingList/ProfessionShoppingList.lua:614: attempt to index field '?' (a number value)
[string "@ProfessionShoppingList/ProfessionShoppingList.lua"]:614: in function <...ns/ProfessionShoppingList/ProfessionShoppingList.lua:592>

This is because at line 672 TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, OnTooltipSetItem) should be put right before the end at line 669. Otherwise the function will be called everytime you mousehover a material in your inventory but will return null since nothing is tracked at the moment.

commented

That's a good call, I probably never noticed this since I do most if not all of the developing with at least one recipe tracked most of the time. I'll make sure this is fixed with the next release.

commented

I had been tweaking the code for a bit because it was overcomplicated, that seemed to have also resolved the issue.

commented

Still seeing this error in today's 019 version. It's not consistent though, it triggers repeatedly when viewing the tooltip of some crafted items and materials but not others. It's also happening despite me turning off the tooltip setting, which I found disappointing.

commented

I'll look into it more closely.

commented

I found the issue. I'll put out a fix, in the meantime you can resolve it through running /psl clear.

commented

Alright, so.
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, OnTooltipSetItem) needs to be run after the OnTooltipSetItem(tooltip) function, otherwise it doesn't actually place the tooltip.
I have however fixed the tooltip code running when the setting is not enabled.

I cannot seem to recreate this particular error though, at all.
@ayoubleborgne Are you still experiencing this issue with the 019 version?
@chilblane Does the error also occur when PSL is the only addon running, and if so, what specific steps can you take to reliably reproduce it?