Multiple Venderor Script Errors core.lua line 1877 function GetItemQualityColor clicking Commander Lo Ping vendor in Townlong Steppes
emmetotter opened this issue ยท 1 comments
Was using my level 60 gnome Hunter with Vendorer as the only enabled addon. All of the errors start with:
Message: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
He sells 1 unusual currency item "Elder Charm of Good Fortune" which requires currency "Lesser Charm of Good Fortune". My hunter does not have any "Elder Charm of Good Fortune" currencies.
The issue is definitely with the "Elder Charm of Good Fortune" which is a currency link item and it seems like the code is not interpreting the return value of C_CurrencyInfo.GetCurrencyInfo correctly (at least for currency links that are sold by vendors).
If I change core.lua line 1876 from this:
local rarity = select(9, Addon:GetCurrencyInfo(itemLink));
to this
local rarity = select(9, Addon:GetCurrencyInfo(itemLink));
if not rarity then
local temp = select(2, Addon:GetCurrencyInfo(itemLink));
rarity=temp.quality
end
The problem stops and rarity becomes a 1 for Elder Charm of Good Fortune, which appears to be its correct value.
Expected Behavior
Screen opens with No errors
Actual Behavior
Because I have /console scriptErrors 1 enabled i see 8 errors but they just seem to be duplicates of these
Error #1
Message: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
Time: Sat Sep 25 17:08:05 2021
Count: 1
Stack: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
[string "=[C]"]: in function `GetItemQualityColor'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1877: in function `UpdateMerchantInfo'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1801: in function <Interface\AddOns\!Vendorer\core.lua:1801>
[string "=[C]"]: in function `MerchantFrame_UpdateMerchantInfo'
[string "@Interface\FrameXML\MerchantFrame.lua"]:140: in function <Interface\FrameXML\MerchantFrame.lua:133>
[string "=[C]"]: in function `MerchantFrame_Update'
[string "@Interface\FrameXML\MerchantFrame.lua"]:102: in function <Interface\FrameXML\MerchantFrame.lua:92>
[string "=[C]"]: in function `Show'
[string "@Interface\FrameXML\UIParent.lua"]:2931: in function `SetUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2776: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2644: in function <Interface\FrameXML\UIParent.lua:2640>
[string "=[C]"]: in function `SetAttribute'
[string "@Interface\FrameXML\UIParent.lua"]:3495: in function `ShowUIPanel'
[string "@Interface\FrameXML\MerchantFrame.lua"]:36: in function <Interface\FrameXML\MerchantFrame.lua:28>
Locals: (*temporary) = nil
Error #2
Message: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
Time: Sat Sep 25 17:12:22 2021
Count: 1
Stack: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
[string "=[C]"]: in function `GetItemQualityColor'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1877: in function `UpdateMerchantInfo'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1801: in function <Interface\AddOns\!Vendorer\core.lua:1801>
[string "=[C]"]: in function `MerchantFrame_UpdateMerchantInfo'
[string "@Interface\AddOns\!Vendorer\core.lua"]:552: in function `SetMerchantItemsPerPage'
[string "@Interface\AddOns\!Vendorer\core.lua"]:571: in function `ShowExtensionPanel'
[string "@Interface\AddOns\!Vendorer\core.lua"]:519: in function `UpdateExtensionPanel'
[string "@Interface\AddOns\!Vendorer\vendorfilter.lua"]:626: in function <Interface\AddOns\!Vendorer\vendorfilter.lua:624>
[string "=[C]"]: in function `MerchantFrame_Update'
[string "@Interface\FrameXML\MerchantFrame.lua"]:102: in function <Interface\FrameXML\MerchantFrame.lua:92>
[string "=[C]"]: in function `Show'
[string "@Interface\FrameXML\UIParent.lua"]:2931: in function `SetUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2776: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2644: in function <Interface\FrameXML\UIParent.lua:2640>
[string "=[C]"]: in function `SetAttribute'
[string "@Interface\FrameXML\UIParent.lua"]:3495: in function `ShowUIPanel'
[string "@Interface\FrameXML\MerchantFrame.lua"]:36: in function <Interface\FrameXML\MerchantFrame.lua:28>
Locals: (*temporary) = nil
Error #3
Message: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
Time: Sat Sep 25 17:12:22 2021
Count: 1
Stack: Interface\AddOns\!Vendorer\core.lua:1877: Usage: GetItemQualityColor(index)
[string "=[C]"]: in function `GetItemQualityColor'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1877: in function `UpdateMerchantInfo'
[string "@Interface\AddOns\!Vendorer\core.lua"]:1801: in function <Interface\AddOns\!Vendorer\core.lua:1801>
[string "=[C]"]: in function `MerchantFrame_UpdateMerchantInfo'
[string "@Interface\FrameXML\MerchantFrame.lua"]:140: in function <Interface\FrameXML\MerchantFrame.lua:133>
[string "=[C]"]: in function `MerchantFrame_Update'
[string "@Interface\FrameXML\MerchantFrame.lua"]:43: in function <Interface\FrameXML\MerchantFrame.lua:28>
Locals: (*temporary) = nil
Steps to Reproduce the Problem
- Travel to Townlong Steppes and go to the Valor and Justice Quartermaster trio
- Enable viewing script errors /console scriptErrors 1
- Click on the Commander Lo Ping vendor. His vendor screen opens and a whole bunch of script errors appear.
Added this currency rarity fix to the PR I made with fixes for Dragonflight. #32